BuildReport

class geodetic_engine.projdb.BuildReport[source]

Bases: object

Provenance for one build, so a result can be traced after the fact.

source

Where the definitions came from: a Georepository base URL, or the path of an OSDU catalogue file.

source_version

The source’s own version, when it states one.

register_versions

Every dataset version the source states, by data source name. A register versions the authority’s own objects and the EPSG dataset it carries separately, and a build is only reproducible against the pair.

cache

What the local response cache contributed, and the versions it had been filled against. Empty when the cache was not used, so a build served from cache is never indistinguishable from a fresh one.

appended

Whether this build added to a database another build had already written, rather than to a fresh copy of the base proj.db. Recorded because it decides what the row counts below are counts of, and because the output then has more than one report describing it.

overwrite_rows

Whether a colliding row of this build’s own authorities was replaced rather than reported as a collision.

property status: str

failed, passed or not validated.

imported_objects()[source]

The objects this build added, as (table, auth_name, code) triples.

Return type:

list[tuple[str, str, str]]

as_dict()[source]

Return the report with everything that went wrong first.

A report is read when something is missing from the database, so the objects that were not imported, the supersessions that were dropped and the validation outcome come before the inventory of what succeeded.

Return type:

dict[str, Any]

to_json(indent=2)[source]

Serialise the report as JSON, problems first.

Parameters:

indent (int, default: 2) – Spaces per indentation level.

Return type:

str

Returns:

The report from as_dict(), as JSON text.

write(path)[source]

Atomically export the report next to the database it describes.

Parameters:

path (Path) – File to write. It is replaced only once the whole report has been written and synced, so a reader never sees half of one.

Return type:

None

__init__(built_at, proj_version, epsg_version, proj_data_version, database_layout_version, source, source_version, authorities, include_deprecated, base_proj_db, output_db, appended=False, overwrite_rows=False, dry_run=False, register_versions=<factory>, cache=<factory>, rows_by_table=<factory>, imported=<factory>, deprecated_imported=<factory>, skipped=<factory>, supersessions_written=0, supersessions_dropped=<factory>, authority_preferences=<factory>, validation=<factory>)