export_persistable_references_from_catalog

geodetic_engine.persistablereference.export_persistable_references_from_catalog(destination, *, format='json', pretty=False, wkt=False, values=None, entity=None, kinds=None, authorities=None, include_deprecated=True, database=None)[source]

Write recorded persistableReferences to a file.

Each entry carries the reference and what is recorded about it: the record id, the object, the kind, the stated authority code, the version, the digest and the source. The reference is the verbatim string unless pretty is given.

With values the named objects are written, in that order, each entry under a query key as well. An object with no reference still gets an entry, with persistable_reference null and a reason, so a missing reference shows up in the file rather than as a gap.

Parameters:
  • destination (Path | IO[str]) – A path, or a text stream to write to.

  • format (ExportFormat, default: "json") – "json", a document holding a list of entries; "jsonl", one compact entry per line; or "csv".

  • pretty (bool, default: False) – JSON only: give each reference as its decoded object, so the document reads naturally.

  • wkt (bool, default: False) – JSON only: also lay each embedded ESRI WKT out over indented lines. The file is then for reading and is not JSON.

  • values (Sequence[str] | None, default: None) – Export these objects, named as persistable_reference_from_catalog() takes them, rather than every reference recorded.

  • entity (Entity | None, default: None) – Only CRSs, or only operations.

  • kinds (Iterable[Kind | str] | None, default: None) – Only references stating these kinds. Not with values.

  • authorities (Iterable[str] | None, default: None) – Only objects of these authorities. Not with values.

  • include_deprecated (bool, default: True) – Include inactive records. Not with values.

  • database (Path | None, default: None) – The proj.db to read; the first on PROJ’s data path by default.

Return type:

int

Returns:

How many references were written, not counting entries for objects that have none.

Raises:

ValueError – If pretty or wkt is given for JSONL or CSV, a filter is given with values, or a value is neither an OSDU id nor "AUTH:CODE".