download_official_catalog¶
- geodetic_engine.osdudb.download_official_catalog(destination=DEFAULT_CATALOG_DESTINATION, *, ref=LATEST, expected_sha256=None, timeout=120.0, transport=None)[source]¶
Download the official OSDU catalogue and verify it.
- Parameters:
destination (
Path, default:DEFAULT_CATALOG_DESTINATION) – Where to write it. Replaced only once the new copy is verified, and left untouched when it already holds that copy.ref (
str, default:LATEST) – The revision to fetch: a commit, branch or tag ofOFFICIAL_CATALOG_PROJECT. Defaults to the newest.expected_sha256 (
str|None, default:None) – The digest the file must have, on top of the one the server states.timeout (
float, default:120.0) – Seconds to wait for the server, per network operation.transport (
BaseTransport|None, default:None) – An httpx transport, for tests.
- Return type:
- Returns:
What was downloaded, and whether it changed the copy at
destination.- Raises:
CatalogDownloadError – If the server cannot be reached, does not answer with the file, the file does not match its digest, or it cannot be written; the copy at
destinationand its record are then left as they were.OsduCatalogError – If the file is not an OSDU manifest.
Example
>>> download_official_catalog().changed False