schematools.utils module

schematools.utils.dataset_schema_from_path(dataset_path: Path | str) types.DatasetSchema

Read a dataset schema from the filesystem.

Parameters

dataset_path – Filesystem path to the dataset.

schematools.utils.dataset_schema_from_url(schemas_url: URL | str, dataset_name: str, prefetch_related: bool = False) types.DatasetSchema

Fetch a dataset schema from a remote file.

schematools.utils.dataset_schemas_from_schemas_path(root: Path | str) dict[str, types.DatasetSchema]

Read all dataset schemas from a directory tree.

Parameters

root – Path of a directory containing dataset schemas in subdirs.

schematools.utils.dataset_schemas_from_url(schemas_url: URL | str, dataset_name: str | None = None, prefetch_related: bool = False) dict[str, types.DatasetSchema]
schematools.utils.schema_from_url(base_url: URL | str, data_type: type, dataset_id: str, prefetch_related: bool = False) types.DatasetSchema

Fetch schema definitions from a remote file for a single dataset.

The URL could be https://schemas.data.amsterdam.nl/datasets/

schematools.utils.schemas_from_url(base_url: URL | str, data_type: type) dict[str, types.DatasetSchema]

Fetch all schema definitions from a remote file.

The URL could be https://schemas.data.amsterdam.nl/datasets/