gcudm

The GeoComm Unified Data Model

This package (gcudm) contains the GeoComm Unified Data Model implemented as a GeoAlchemy2 object-relational model.

Each version of the package represents the corresponding version of the data model.

If you want to get started using the library, check out the tutorial.

gcudm

Tutorial

Installation

You can install the library using pip.

pip install gcudm

If you need a specific version of the data model, specify it when you install.

pip install gcudm==0.0.1

Build Your Database

gcudm is built on GeoAlchemy 2 (and SqlAlchey). We try not to come between you and the underlying platforms, so if you’re familiar with these frameworks everything should work as you expect.

One convenience that is provided is the gcudm.model.load() function which you can call to make sure that all the modules that define object-relational mappings are loaded. You should do this before you create your database tables from the model to make sure that all the classes that implement the declarative base are loaded.

from gcudm.base import Base
import gcudm.model
from sqlalchemy import create_engine

# Load the entire model.
gcudm.model.load()

# The rest is standard SQLAlchemy...
# ...just create an engine.
engine = create_engine(
    'postgresql://<user>:<password>@<host>/<your-database>',
    echo=True)

# Now create the tables in your database.
Base.metadata.create_all(engine)
gcudm

Data Model

Road Centerlines

class gcudm.models.road_centerlines.RoadCenterline(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base, gcudm.base.ModelMixin

378add657d7541f8aca185a1d2b00b39_tbl 378add657d7541f8aca185a1d2b00b39_geom Road centerlines are the principal polyline features that represent road segments traversable by most emergency vehicles.

Table Name:road_centerlines
Geometry Type:Linestring
addCodeL

d9829d6375044491a2b9df8771eba4b6 Additional Code Left

This field needs a description.

Search Display
Requested Required
NENA:AddCode_L
addCodeR

d0752f087c174ee7a70c2ca7ddf4ee78 Additional Code Right

This field needs a description.

Search Display
Requested Required
NENA:AddCode_R
addRngPreL

c0eeb5c57fbb4e6892d3544983e8a2db Left Address Number Prefix

This field needs a description.

Search Display
Requested Required
NENA:AdNumPre_L
addRngPreR

fd3b421d2ea3427caf80ef73df35d1cf Right Address Number Prefix

This field needs a description.

Search Display
Requested Required
NENA:AdNumPre_R
countryL

c5df81cb17614b3188c0113f686d349b Country Left

This field needs a description.

Search Display
Requested Required
NENA:Country_L
countryR

87ac2815a99f4c9cb22faefd3c03761f Country Right

This field needs a description.

Search Display
Requested Required
NENA:Country_R
effective

fd36d6e12be84a9f9ca0de6f533622e5 Effective Date

This field needs a description.

Search Display
Requested Required
esnL

77c411e964b540e891ddc926977a0f74 ESN Left

This field needs a description.

Search Display
Requested Required
NENA:ESN_L
esnR

9b2352cf74c74877b0d540a3b33b9236 ESN Right

This field needs a description.

Search Display
Requested Required
NENA:ESN_R
expire

0b2e3142bce14fdba55e1ab91c9ea980 Expiration Date

This field needs a description.

Search Display
Requested Required
fromAddL

4beefbfaf9b5475fa5505df4fbd09736 Left ‘From’ Address

This field needs a description.

Search Display
Requested Required
NENA:FromAddr_L
fromAddR

cfa85e0ee21b4f908300258066be9f98 Right ‘From’ Address

This field needs a description.

Search Display
Requested Required
NENA:FromAddr_R
gcUnqId

45fe5774152f4c50917be9f04140a5b7 GeoComm ID

This field needs a description.

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

Get the geometry type defined for the model class.

Returns:the geometry type
incMuniL

550b378ec88d477c800e1ea505d84a1f Incorporated Municipality Left

This field needs a description.

Search Display
Requested Required
NENA:IncMuni_L
incMuniR

bee70a65af714794b0c31cb11bb699db Incorporated Municipality Right

This field needs a description.

Search Display
Requested Required
NENA:IncMuni_R
lgcyName

b629a25fbfeb46e1900809de25400a2f Legacy Street Name

This field needs a description.

Search Display
Requested Required
NENA:LSt_Name
lgcyPrTySp

d9e0ca5fe831445790b2b69a4aa018de Legacy Street Name Pre Type Separator

This field needs a description.

Search Display
Requested Required
lgcyPrType

2cb3a29112eb4f28909f48b2239499e9 Legacy Street Name Pre Type

This field needs a description.

Search Display
Requested Required
NENA:LSt_PreDir
lgcyPreDir

a6376437b8544e5a95d9edb0f669c5fb Legacy Street Name Pre Directional

This field needs a description.

Search Display
Requested Required
lgcyPreMod

cc649ef759344f52a8d9aad859a597de Legacy Street Name Pre Modifier

This field needs a description.

Search Display
Requested Required
lgcyPstDir

feeb865cb1194118bf7a8dfd5f9c9f94 Legacy Street Name Post Directional

This field needs a description.

Search Display
Requested Required
NENA:LStPosDir
lgcyPstMod

addb5ee91ef048798560806baad1ba9c Legacy Street Name Post Modifier

This field needs a description.

Search Display
Requested Required
lgcyType

b1faec1adcb34d61b57da3e0b1b12da4 Legacy Street Name Post Type

This field needs a description.

Search Display
Requested Required
NENA:LSt_Type
metadata = MetaData(bind=None)
msagCommL

461d500a1f9b4fb78130fde4bcb40cf5 MSAG Community Name Left

This field needs a description.

Search Display
Requested Required
NENA:MSAGComm_L
msagCommR

81eb9cc4fa3c4cf4a4544b36f255675b MSAG Community Name Right

This field needs a description.

Search Display
Requested Required
NENA:MSAGComm_R
parityL

aae244ce504642c6855789a450525a6b Parity Left

This field needs a description.

Search Display
Requested Required
NENA:Parity_L
parityR

faf3f2cb6cd648818c365deb984fa656 Parity Right

This field needs a description.

Search Display
Requested Required
NENA:Parity_R
postDir

8fdf08bc8b7946efb733aeeed8d965cc Street Name Post Directional

This field needs a description.

Search Display
Requested Required
NENA:St_PosDir
postMod

b871fe2bee854fbd8e3d5c90964fb52a Street Name Post Modifier

This field needs a description.

Search Display
Requested Required
NENA:St_PosMod
postType

c63db7c4ce9b42a4affa90d6ff854e56 Street Name Post Type

This field needs a description.

Search Display
Requested Required
NENA:St_PosTyp
preDir

e681f1091a6348fb8b5afba812c00da6 Street Name Pre Directional

This field needs a description.

Search Display
Requested Required
NENA:St_PreDir
preMod

15670dac86464738afabeef793ae2e7d Street Name Pre Modifier

This field needs a description.

Search Display
Requested Required
NENA:St_PreMod
preType

e306411cf1fd4f95980d818ffdf6d715 Street Name Pre Type

This field needs a description.

Search Display
Requested Required
NENA:St_PreTyp
preTypeSep

123179964a0d4dda8285b15ccd1144a3 Street Name Pre Type Separator

This field needs a description.

Search Display
Requested Required
NENA:St_PreSep
rngType

a126002e4ff44adebfdff24c12c506bb Ranging Type

This field needs a description.

Search Display
Requested Required
srcFullNam

here is an annotation!

srcLastEd

0cf74e0d0042450e9cdf2f9841bbea05 Source of Last Update

This field needs a description.

Search Display
Requested Required
srcOfData

5c196f29eaae431dafcbcc7678a21a6f Data Source

This field needs a description.

Search Display
Requested Required
srcUnqId

52f6845855564f9fbd606fe89b03d57e NENA ID

This field needs a description.

Search Display
Requested Required
NENA:RCL_NGUID
stateL

db4ed545217d444ca193bd4c6bac61b0 State Left

This field needs a description.

Search Display
Requested Required
NENA:State_L
stateR

7aad354a072b48ebaeaa19e33e857289 State Right

This field needs a description.

Search Display
Requested Required
NENA:State_R
strName

85bb91a4350a4ab1914229bc9e739049 Street Name

This field needs a description.

Search Display
Requested Required
NENA:StreetName
toAddL

f67cedb7b3f04ad785f714f86750c1de Left ‘To’ Address

This field needs a description.

Search Display
Requested Required
NENA:ToAddr_L
toAddR

1565badf0db24546bcd7d50c35e89f75 Right ‘To’ Address

This field needs a description.

Search Display
Requested Required
NENA:ToAddr_R
unincCommL

ba2468a66a6c45a399c6ea293ce0ad66 Unincorporated Community Left

This field needs a description.

Search Display
Requested Required
NENA:UnincCom_L
unincCommR

e313c7409baa4457b1fb3256bfd2cd5c Unincorporated Community Right

This field needs a description.

Search Display
Requested Required
NENA:UnincCom_R
updateDate

31ddab2b20b34211a1414ce22dd09bfe Last Update

This field needs a description.

Search Display
Requested Required
uploadAuth

3df7fcf36a2b4db3a3350f6c4222ee4b Upload Authority

This field needs a description.

Search Display
Requested Required

Emergency Service Boundaries (EMS)

Say something descriptive about the ‘esbems’ module.

class gcudm.models.esbems.EsbEms(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base, gcudm.base.ModelMixin, gcudm.models.esbs.EsbMixin

f6e994f7fd1945f681902201377a60a1_tbl f6e994f7fd1945f681902201377a60a1_geom This table needs a description.

Table Name:esbems
Geometry Type:Polygon
agencyID

8954c44776434e19aac7d546395f2fea Agency ID

This field needs a description.

Search Display
Requested Required
NENA:Agency_ID
country

dcbcca9d8673430eb583bd0a34da0eaf Country

This field needs a description.

Search Display
Requested Required
county

3294177c98d2468ba9d51ebb91e49c4e County

This field needs a description.

Search Display
Requested Required
displayName

92e54bda9fbd464e9de909d2f97b3eb6 Display Name

This field needs a description.

Search Display
Requested Required
NENA:DisplayName
effective

b24e9ce0fe884043bdd354bc5d5cf588 Effective Date

This field needs a description.

Search Display
Requested Required
expire

365b914456444ef1969f438c674598e8 Expiration Date

This field needs a description.

Search Display
Requested Required
gcUnqId

a3566749d08d4aab99007e393434ba95 GeoComm ID

This field needs a description.

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

Get the geometry type defined for the model class.

Returns:the geometry type
metadata = MetaData(bind=None)
routeURI

0c527af1d03e4b25a00b67def1b18ff3 Service URI

This field needs a description.

Search Display
Requested Required
NENA:ServiceURI
serviceNum

6d81f49e68994ee18301b9db8abc2e10 Service Number

This field needs a description.

Search Display
Requested Required
NENA:ServiceNum
serviceURN

147d89445180439cb7010ac07a0964af Service URI

This field needs a description.

Search Display
Requested Required
NENA:ServiceURI
srcLastEd

64c1dba7e4634b52b2970a5e685074ac Source of Last Update

This field needs a description.

Search Display
Requested Required
srcOfData

0fc8d4b32e054beaa2634a0871db23dc Data Source

This field needs a description.

Search Display
Requested Required
srcUnqId

8558931bd72246fbb0116e5bda7956b0 NENA ID

This field needs a description.

Search Display
Requested Required
NENA:RCL_NGUID
state

8c29f73611d64e6082657ea0b69e662f State

This field needs a description.

Search Display
Requested Required
updateDate

20d742f4e538425aad470d4ea771d717 Last Update

This field needs a description.

Search Display
Requested Required
uploadAuth

81a362d9b9b14c1fac178a3cbc7fd42d Upload Authority

This field needs a description.

Search Display
Requested Required
vCardURI

28fec80c5fbd478f9d5ae758fbe6d8ea Agency vCard URI

This field needs a description.

Search Display
Requested Required
NENA:AVcard_URI

Emergency Service Boundaries (Fire)

Say something descriptive about the ‘esbfire’ module.

class gcudm.models.esbfire.EsbFire(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base, gcudm.base.ModelMixin, gcudm.models.esbs.EsbMixin

874ad1441db2477bbf45f8891d9eb849_tbl 874ad1441db2477bbf45f8891d9eb849_geom This table needs a description.

Table Name:esbfire
Geometry Type:Polygon
agencyID

76661ec2548541f4a7d61c821d5d30aa Agency ID

This field needs a description.

Search Display
Requested Required
NENA:Agency_ID
country

c1c7ba3044d942b6bb0704cc9d362c0e Country

This field needs a description.

Search Display
Requested Required
county

ae0a1a62b450476095928d74bdbff296 County

This field needs a description.

Search Display
Requested Required
displayName

b1243b28230741829abe57afa405cfd1 Display Name

This field needs a description.

Search Display
Requested Required
NENA:DisplayName
effective

69d3aca0b21c44d9add80ffd96a2a511 Effective Date

This field needs a description.

Search Display
Requested Required
expire

902bab9053f241b9828a635f8061a7e3 Expiration Date

This field needs a description.

Search Display
Requested Required
gcUnqId

544ede6f4bb342faa6de127ffe5e026f GeoComm ID

This field needs a description.

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

Get the geometry type defined for the model class.

Returns:the geometry type
metadata = MetaData(bind=None)
routeURI

24485fd4564c4613917c9638301e4d56 Service URI

This field needs a description.

Search Display
Requested Required
NENA:ServiceURI
serviceNum

2bf3acef5a4941dd9039d3506551e519 Service Number

This field needs a description.

Search Display
Requested Required
NENA:ServiceNum
serviceURN

ff71ee042fb448b2bff488ca3a158675 Service URI

This field needs a description.

Search Display
Requested Required
NENA:ServiceURI
srcLastEd

fcc68d5d25704800ac6cecf734182b56 Source of Last Update

This field needs a description.

Search Display
Requested Required
srcOfData

aba613e8451d44e3a02efd8850d860de Data Source

This field needs a description.

Search Display
Requested Required
srcUnqId

ad0eca32eafd4eb79baf55d17acadaa7 NENA ID

This field needs a description.

Search Display
Requested Required
NENA:RCL_NGUID
state

508f32b0459b4050a4bd519ca16e26df State

This field needs a description.

Search Display
Requested Required
updateDate

7140cb2b0aa448a88fa29928fb1dcfac Last Update

This field needs a description.

Search Display
Requested Required
uploadAuth

976fcfb477264b0c839087a19a56a401 Upload Authority

This field needs a description.

Search Display
Requested Required
vCardURI

e89b2119fef64fc8b061ffced41a4302 Agency vCard URI

This field needs a description.

Search Display
Requested Required
NENA:AVcard_URI

Emergency Service Boundaries (Law)

Say something descriptive about the ‘esblaw’ module.

class gcudm.models.esblaw.EsbLaw(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base, gcudm.base.ModelMixin, gcudm.models.esbs.EsbMixin

5d05b92edd6e49bba03365ce8cab3f6d_tbl 5d05b92edd6e49bba03365ce8cab3f6d_geom Emergency service boundaries for law enforcement define the areas to which law enforcement responds.

Table Name:esblaw
Geometry Type:Polygon
agencyID

8e30db3d652b442a8646b4072ba84c36 Agency ID

This field needs a description.

Search Display
Requested Required
NENA:Agency_ID
country

e989bf6310374b229a78ac6352c1ff93 Country

This field needs a description.

Search Display
Requested Required
county

40239ddfd5964cb1884514797fcfbd6b County

This field needs a description.

Search Display
Requested Required
displayName

57c229902ebb4bb89c9844b116816ff0 Display Name

This field needs a description.

Search Display
Requested Required
NENA:DisplayName
effective

c0e900521d124d55b72a039955ade12c Effective Date

This field needs a description.

Search Display
Requested Required
expire

044d15defee14649ad375678f5d30c91 Expiration Date

This field needs a description.

Search Display
Requested Required
gcUnqId

794ef5c4ed1a471787e287accd93415d GeoComm ID

This field needs a description.

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

Get the geometry type defined for the model class.

Returns:the geometry type
metadata = MetaData(bind=None)
routeURI

e168a6c0671a4700b0a564596f5a12aa Service URI

This field needs a description.

Search Display
Requested Required
NENA:ServiceURI
serviceNum

68ee3d9bbc394c1a96d19fc3e21186e1 Service Number

This field needs a description.

Search Display
Requested Required
NENA:ServiceNum
serviceURN

81aa4aff5b284ef68f2cbe054d3ea125 Service URI

This field needs a description.

Search Display
Requested Required
NENA:ServiceURI
srcLastEd

b3c3810b0f1e4aa88b051257a21a4a1d Source of Last Update

This field needs a description.

Search Display
Requested Required
srcOfData

547fe8c7567246e8aca24c9bed8f7284 Data Source

This field needs a description.

Search Display
Requested Required
srcUnqId

78f7cc22b8734786b03c536210a0105f NENA ID

This field needs a description.

Search Display
Requested Required
NENA:RCL_NGUID
state

3bee59dc020a46ab933a67d513b6da87 State

This field needs a description.

Search Display
Requested Required
updateDate

216e3beae672490790c5166336bb788a Last Update

This field needs a description.

Search Display
Requested Required
uploadAuth

c8a29c6c4b0d4557b937a25d41c923e6 Upload Authority

This field needs a description.

Search Display
Requested Required
vCardURI

e1965b2699cf41a78ee007780f334293 Agency vCard URI

This field needs a description.

Search Display
Requested Required
NENA:AVcard_URI

Emergency Service Boundaries (PSAP)

Say something descriptive about the ‘esbpsap’ module.

class gcudm.models.esbpsap.EsbPsap(**kwargs)[source]

Bases: sqlalchemy.ext.declarative.api.Base, gcudm.base.ModelMixin, gcudm.models.esbs.EsbMixin

759e0c57b4844e26930963f34850ac4b_tbl 759e0c57b4844e26930963f34850ac4b_geom This table needs a description.

Table Name:esbpsap
Geometry Type:Polygon
agencyID

1c72135995c84125a2547cd7e2a7cdfd Agency ID

This field needs a description.

Search Display
Requested Required
NENA:Agency_ID
country

dfc61452174a42698225ba2fc33395c6 Country

This field needs a description.

Search Display
Requested Required
county

c4885b2faef54904b5edd9f243342903 County

This field needs a description.

Search Display
Requested Required
displayName

7be17b9912ea4fe98167512547c384bf Display Name

This field needs a description.

Search Display
Requested Required
NENA:DisplayName
effective

b346c6d51b554993bc5068196356683f Effective Date

This field needs a description.

Search Display
Requested Required
expire

fe0e6c1932814fec8e5adac864034f46 Expiration Date

This field needs a description.

Search Display
Requested Required
gcUnqId

e5df7fa5e1f840ba90affed572175693 GeoComm ID

This field needs a description.

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

Get the geometry type defined for the model class.

Returns:the geometry type
metadata = MetaData(bind=None)
routeURI

a249a64f5e324f84b6dbed5a6195e557 Service URI

This field needs a description.

Search Display
Requested Required
NENA:ServiceURI
serviceNum

236da936b0b648bfa7d427bbe5661740 Service Number

This field needs a description.

Search Display
Requested Required
NENA:ServiceNum
serviceURN

d8febc548f9d4c1c8a450ac3974d4f87 Service URI

This field needs a description.

Search Display
Requested Required
NENA:ServiceURI
srcLastEd

8689b89149f24d4394ea871e9a3847af Source of Last Update

This field needs a description.

Search Display
Requested Required
srcOfData

52698d9499ca4a2f8eb40fb719fbd5d2 Data Source

This field needs a description.

Search Display
Requested Required
srcUnqId

0387e64ca4e240e79d0f561a9dc5f246 NENA ID

This field needs a description.

Search Display
Requested Required
NENA:RCL_NGUID
state

6f9afe02f8414a8f8a99333788f56c60 State

This field needs a description.

Search Display
Requested Required
updateDate

5655a162d9e14ddb946489ab5126d0fd Last Update

This field needs a description.

Search Display
Requested Required
uploadAuth

343dfdf57ca84266bbef173d7ed63fe4 Upload Authority

This field needs a description.

Search Display
Requested Required
vCardURI

2143d04fbcd74878b7cf08a2ab6367d0 Agency vCard URI

This field needs a description.

Search Display
Requested Required
NENA:AVcard_URI
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)

9d41623506314823927f83aeaa9fae5d Effective Date

This field needs a description.

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

b6369c08ca71461eb6a15af942095cac Expiration Date

This field needs a description.

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

eab2bb21665b4d16a40918312ce54fcd 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)

957994dd00404a35b147a327dedb2e69 Source of Last Update

This field needs a description.

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

fa505450bcad47cb9878004d801f1fc0 Data Source

This field needs a description.

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

86b79a0f77104bc99a322cd708ba1292 NENA ID

This field needs a description.

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

7675fec256974bf4bd3e640d81098c91 Last Update

This field needs a description.

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

2f0677b7b4894ad9a06fc05992ef8bea 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.

Python Module Dependencies

The requirements.txt file contains this project’s module dependencies. You can install these dependencies using pip.

pip install -r requirements.txt

requirements.txt

GeoAlchemy2>=0.4.2,<1
parameterized>=0.6.1,<1
pip-check-reqs>=2.0.1,<3
psycopg2>=2.7.4,<3
psycopg2-binary>=2.7.4,<3
pylint>=1.8.4,<2
pytest>=3.4.0,<4
pytest-cov>=2.5.1,<3
pytest-pythonpath>=0.7.2,<1
setuptools>=38.4.0
Sphinx>=1.7.1,<2
sphinx-rtd-theme>=0.2.4,<1
SQLAlchemy>=1.2.6,<2
singleton-decorator>=1.0.0,<2
titlecase>=0.12.0,<1
tox>=3.0.0,<4
twine>=1.11.0,<2

Indices and tables