Skip to content
Framework

Data

pull_data_registry()

Bring the project's data catalog up to date with its data registry on Framework Cloud.

Reads the registry with the project token (GET /api/v1/projects/data) and lists the changes first: entries to add, entries whose path, type, or options differ, and entries only in this project. Then asks "Apply these changes?".

Only the definitions move. Data files are never downloaded, and file hashes stay in the project's framework.db. Applying writes the new entries into the settings' data section (inline, or in its split file such as settings/data.yml), keeping the file's comments. Local entries are never removed, and an entry whose local definition differs keeps it unless overwrite=True. Fields Framework Cloud does not store remain unchanged. The revision pulled is kept in .framework/data.lock.json for push_data_registry(). pull_all() pulls it with the packages and skills.

Usage

pull_data_registry(
    project_path: str | Path = '.',
    overwrite: bool = False,
    confirm: bool | None = None,
    dry_run: bool = False,
) -> dict[str, Any]

Arguments

Name Type Default Description
project_path str | Path '.'

The project's root directory. Default: the current directory.

overwrite bool False

Use Cloud's definitions for entries that differ.

confirm bool | None None

True applies without asking; False cancels. None asks in a console.

dry_run bool False

List the changes and write nothing.

Value

A dict: revision, entries (added, changed, differ_kept, and kept_local, as names), applied, dry_run, and message.

Raises

  • CloudError: Without a project token, offline, when the token is refused, or when the server has no data registry endpoint. Nothing changes then.
  • FrameworkError: Without a console and without confirm=True or dry_run=True.

Search guides and reference for R, Python, Stata, the CLI, and Framework Cloud.