dicogis.publishing.udata module¶
Publication of DicoGIS metadata to a uData catalog.
UI-agnostic core shared by the dicogis-cli publish command and the GUI’s “Publish” tab: it depends on neither Typer nor Qt.
- dicogis.publishing.udata.publish_metadata_folder(input_folder, udata_api_key, udata_api_url_base='https://demo.data.gouv.fr/api/', udata_api_version='1', udata_organization_id=None, progress_reporter=None, verbose=False, timeout=None, http_client=None)¶
Publish every DicoGIS metadata JSON file within a folder to a uData catalog.
This is the core, UI-agnostic logic shared by the dicogis-cli publish command and the GUI’s “Publish” tab.
- Parameters:
input_folder (
Path) – folder where metadata JSON files (udata flavor) are stored.udata_api_key (
str) – API key of the account on the uData instance.udata_api_url_base (
str) – API URL of the uData instance.udata_api_version (
str) – API version of the uData instance.udata_organization_id (
str|None) – organization ID in the uData instance. If set, datasets are added to the organization instead of the user authenticated with the API key.progress_reporter (
ProgressReporter|None) – told about each JSON file examined. Asking it to stop ends the run between two files, with a report of what was done until then.verbose (
bool) – log ignored files (not DicoGIS or already published) at info level.timeout (
float|None) – seconds to wait for the catalog. Defaults to the DICOGIS_PUBLISH_TIMEOUT environment variable, or 30 seconds.http_client (
HttpClient|None) – HTTP client. Defaults to the one of the running environment.
- Raises:
FileNotFoundError – if input_folder contains no JSON file.
ValueError – if udata_api_key is empty.
- Return type:
- Returns:
counters and per-file error messages for the run.