gcudm

API Documentation

gcudm

GeoComm Unified Data Model

gcudm.base

The GeoAlchemy declarative base for the data model is defined in this module along with some other helpful classes.

class gcudm.base.Base(**kwargs)

Bases: object

The most base type

metadata = MetaData(bind=None)
class gcudm.base.ModelMixin[source]

Bases: object

This mixin includes columns and methods common to objects within the data model.

effective = Column(None, DateTime(), table=None)

cfe7f6f7219e4c62a43bc21472fc1ea8 Effective Date

This field needs a description.

Search Display
Requested Required
expire = Column(None, DateTime(), table=None)

f180db5c87764f7d82f505870b8be4e3 Expiration Date

This field needs a description.

Search Display
Requested Required
gcUnqId = Column(None, GUID(), table=None, primary_key=True, nullable=False)

ae928ae990714c5099354566b1ac163d GeoComm ID

This field needs a description.

Search Display
Requested Required
classmethod geometry_type() → gcudm.geometry.GeometryTypes[source]

Get the geometry type defined for the model class.

Returns:the geometry type
srcLastEd = Column(None, DateTime(), table=None)

7fab4d4e1fc241e6b38386ebd036b26d Source of Last Update

This field needs a description.

Search Display
Requested Required
srcOfData = Column(None, String(), table=None)

b7f8da204de1407ba75e95e0645e7640 Data Source

This field needs a description.

Search Display
Requested Required
srcUnqId = Column(None, String(), table=None)

81b6d484b2534b3094a8cccbea0b3adf NENA ID

This field needs a description.

Search Display
Requested Required
NENA:RCL_NGUID
updateDate = Column(None, DateTime(), table=None)

4a02b5fa53184f4c8ba50c535c3782de Last Update

This field needs a description.

Search Display
Requested Required
uploadAuth = Column(None, String(), table=None)

01e5aa739a4746ec89ad1ce418c041e3 Upload Authority

This field needs a description.

Search Display
Requested Required

gcudm.meta

This module contains metadata objects to help with inline documentation of the model.

gcudm.meta.COLUMN_META_ATTR = '__meta__'

the property that contains column metadata

class gcudm.meta.ColumnMeta[source]

Bases: tuple

Metadata for table columns.

Variables:
  • label (str) – a human-friendly label for the column
  • description (str) – a human-friendly description of the column
  • nena (str) – the name of the equivalent NENA field
  • requirement (Requirement) – defines the source data contract
  • usage (Usage) – defines how the data in the column is expected to be used
  • guaranteed (bool) – Is the column guaranteed to contain a non-empty value?
  • calculated (bool) – May the column’s value be generated or modified by a calculation?
calculated
description
get_enum(enum_cls: Type[Union[gcudm.meta.Requirement, gcudm.meta.Usage]]) → gcudm.meta.Requirement[source]

Get the current value of an attribute defined by an enumeration.

Parameters:enum_cls – the enumeration class
Returns:the value of the attribute
guaranteed
label
nena
requirement
usage
class gcudm.meta.Requirement[source]

Bases: enum.IntFlag

This enumeration describes contracts with source data providers.

NONE = 0

data for the column is neither requested nor required

REQUESTED = 1

data for the column is requested

REQUIRED = 3

data for the column is required

gcudm.meta.TABLE_META_ATTR = '__meta__'

the property that contains table metadata

class gcudm.meta.TableMeta[source]

Bases: tuple

Metadata for tables.

Variables:label (str) – a human-friendly label for the column
label
class gcudm.meta.Usage[source]

Bases: enum.IntFlag

This enumeration describes how data may be used.

DISPLAY = 2

The data is displayed to users.

NONE = 0

The data is not used.

SEARCH = 1

The data is used for searching.

gcudm.meta.column(dtype: Any, meta: gcudm.meta.ColumnMeta, *args, **kwargs) → sqlalchemy.sql.schema.Column[source]

Create a GeoAlchemy Column annotated with metadata.

Parameters:
  • dtype – the GeoAlchemy column type
  • meta – the meta data
Returns:

a GeoAlchemy Column

gcudm.model

This module contains general members to help you work with the model.

gcudm.model.IS_MODEL_CLASS = '__model_cls__'

signifies a model class

gcudm.model.load()[source]

Load the data model.

gcudm.model.model(label: str)[source]

Use this decorator to provide meta-data for your model class.

Parameters:label – the friendly label for the class

gcudm.types

This module contains custom GeoAlchemy/SQLAlchemy types.

class gcudm.types.GUID(*args, **kwargs)[source]

Bases: sqlalchemy.sql.type_api.TypeDecorator

This is a Platform-independent GUID type that uses PostgreSQL’s UUID type ( and otherwise uses CHAR(32), storing as stringified hex values.

impl

alias of sqlalchemy.sql.sqltypes.CHAR

load_dialect_impl(dialect)[source]

Return a TypeEngine object corresponding to a dialect.

This is an end-user override hook that can be used to provide differing types depending on the given dialect. It is used by the TypeDecorator implementation of type_engine() to help determine what type should ultimately be returned for a given TypeDecorator.

By default returns self.impl.

process_bind_param(value, dialect)[source]

Receive a bound parameter value to be converted.

Subclasses override this method to return the value that should be passed along to the underlying TypeEngine object, and from there to the DBAPI execute() method.

The operation could be anything desired to perform custom behavior, such as transforming or serializing data. This could also be used as a hook for validating logic.

This operation should be designed with the reverse operation in mind, which would be the process_result_value method of this class.

Parameters:
  • value – Data to operate upon, of any type expected by this method in the subclass. Can be None.
  • dialect – the Dialect in use.
process_result_value(value, dialect)[source]

Receive a result-row column value to be converted.

Subclasses should implement this method to operate on data fetched from the database.

Subclasses override this method to return the value that should be passed back to the application, given a value that is already processed by the underlying TypeEngine object, originally from the DBAPI cursor method fetchone() or similar.

The operation could be anything desired to perform custom behavior, such as transforming or serializing data. This could also be used as a hook for validating logic.

Parameters:
  • value – Data to operate upon, of any type expected by this method in the subclass. Can be None.
  • dialect – the Dialect in use.

This operation should be designed to be reversible by the “process_bind_param” method of this class.