ferrosoft.apps.emiflow.catalog package

Submodules

ferrosoft.apps.emiflow.catalog.conversion module

Import utilities for catalog files.

exception ferrosoft.apps.emiflow.catalog.conversion.CatalogConversionError[source]

Bases: Exception

class ferrosoft.apps.emiflow.catalog.conversion.CatalogSchema(*values)[source]

Bases: StrEnum

BASE = 'https://emiflow.de/schema/catalog.schema.json'
TOC = 'https://emiflow.de/schema/toc.schema.json'
TRANSPORT = 'https://emiflow.de/schema/transport.schema.json'
exception ferrosoft.apps.emiflow.catalog.conversion.CatalogValidationError[source]

Bases: Exception

class ferrosoft.apps.emiflow.catalog.conversion.IdResolver[source]

Bases: object

static lookup_reference(id_cache, external_id)[source]
Return type:

str

lookup_unit(symbol)[source]
Return type:

str

ferrosoft.apps.emiflow.catalog.conversion.catalog_to_fixtures(catalog)[source]

Convert (presumed valid) catalog to fixtures list.

Return type:

Iterable[dict]

ferrosoft.apps.emiflow.catalog.conversion.convert_catalog_files(catalog_file_names, schema_base_name)[source]
Return type:

list

ferrosoft.apps.emiflow.catalog.conversion.emiflow_static_file(file_name)[source]

Find static file inside emiflow app.

Raises:

RuntimeError if the file is not found.

Return type:

str

ferrosoft.apps.emiflow.catalog.conversion.get_converter(schema_id)[source]
ferrosoft.apps.emiflow.catalog.conversion.toc_to_fixtures(catalog)[source]
Return type:

Iterable[dict]

ferrosoft.apps.emiflow.catalog.conversion.transport_to_fixtures(catalog)[source]
ferrosoft.apps.emiflow.catalog.conversion.validate_catalog(catalog, schema_base_name)[source]

Validate catalog dict against emiflow catalog schema.

Return type:

Tuple[CatalogSchema, list]

ferrosoft.apps.emiflow.catalog.database module

ferrosoft.apps.emiflow.catalog.database.import_builtin_fixtures(language=None)[source]

Import very useful and important fixtures.

ferrosoft.apps.emiflow.catalog.database.import_emiflow_catalog(catalog, schema)[source]