caf.ntem.build#

Build an NTEM database to be used by the query module for extracting data.

Module Attributes

METADATA_ID_COLUMN

Name of the metadata ID column in the database.

ZONE_SYSTEM_ID_COLUMN

Name of the zone system ID column in the database.

ZONE_ID_COLUMN

Name of the zone ID column in the database.

Functions

NamedTuple(typename[, fields])

Typed version of namedtuple.

build_db(access_dir, output_dir[, scenarios])

Process the NTEM data from the access files and outputs a SQLite database.

check_dependencies()

Check if the dependencies are installed.

create_geo_lookup_table(session, ...)

Create and insert geo lookup tables using the access data.

create_lookup_tables(connection, lookup_path)

Insert lookup tables into the database.

process_scenario(connection, label, ...)

Process data for a scenario and version and insert in into the database.

set_sqlite_pragma(dbapi_connection, _)

Set the foreign key pragma for SQLite.

Classes

AccessTables(value)

Defines the names of the access data tables.

BuildArgs(*, output_path, directory[, scenarios])

Input arguments for the build command.

FileType(scenario, version)

A named tuple for storing the scenario and version of a file.

Attributes Documentation

caf.ntem.build.METADATA_ID_COLUMN = 'metadata_id'#

Name of the metadata ID column in the database.

caf.ntem.build.ZONE_SYSTEM_ID_COLUMN = 'zone_type_id'#

Name of the zone system ID column in the database.

caf.ntem.build.ZONE_ID_COLUMN = 'zone_id'#

Name of the zone ID column in the database.