Relational

This (sub)package is provides the content management framework for container objects and a collection of static data for reference and unit conversions.

exa.relational.__init__.load_isotope_data()[source]

Load isotope data into the database (replacing existing).

exa.relational.__init__.load_unit_data()[source]

Load unit conversions into the database (replacing existing).

Note

This function actually computes (prior to bulk inserting data) conversion factors.

exa.relational.__init__.load_constant_data()[source]

Load constants into the database (replacing existing).

Database Engine Configuration

This module provides the base classes and metaclasses for relational tables created by exa. It also provides the database engine configuration and session class factory.

exa.relational.base.generate_hexuid()[source]

Create a unique, random, hex string id.

exa.relational.base.cleanup_engine()[source]

At exit, cleanup connection pool.

exa.relational.base.scoped_session(*args, **kwargs)[source]

Safely commit relational objects.

class exa.relational.base.BaseMeta(classname, bases, dict_)[source]

This is the base metaclass for all relational tables. It provides convient lookup methods, bulk insert methods, and conversions to other formats.

get_by_pkid(pkid)[source]

Select an object by pkid.

get_by_name(name)[source]

Select objects by name.

get_by_uid(uid)[source]

Select an object by hexuid (as string)

bulk_insert(mappings)[source]

Perform a bulk insert into a specific table.

mappings = [{'column1': 'foo', 'column2': 42, 'column3': 'bar'},
            {'column1': 'fop', 'column2': 43, 'column3': 'baz'}]
Table.bulk_insert(mappings)
to_frame()[source]

Dump the table to a DataFrame object.

Warning

If performing this action on a very large table, may raise a memory error. It is almost always more effective to query the table for the specific records of interest.

class exa.relational.base.Name[source]

Name and description fields.

class exa.relational.base.HexUID[source]

Hex-based unique id (uid) field.

class exa.relational.base.Time[source]

Timestamp fields.

class exa.relational.base.Size[source]

Approximate size (on disk) and file count fields.