TableManager

class felis.tap_schema.TableManager(engine=None, initialize_database=False, schema_name=None, table_name_postfix='')

Bases: object

Manage creation of TAP_SCHEMA tables.

Parameters:
  • engine (Engine | None, default: None) – The SQLAlchemy engine for reflecting the TAP_SCHEMA tables from an existing database. If initialize_database is True, this engine will be used to create the tables. If None, an in-memory SQLite database will be used.

  • schema_name (str | None, default: None) – The name of the schema to use for the TAP_SCHEMA tables. If None, the standard name of ‘TAP_SCHEMA’ will be used.

  • table_name_postfix (str, default: '') – A string which will be appended to each of the standard table names. This needs to be used in a way such that the resultant table names map to tables existing tables within a TAP_SCHEMA database.

  • initialize_database (bool, default: False)

Attributes Summary

metadata

Get the metadata for the TAP_SCHEMA tables.

schema

Get the TAP_SCHEMA schema.

Methods Summary

get_schema_name_std()

Get the standard schema name for the TAP_SCHEMA tables.

get_table_names_std()

Get the standard column names for the TAP_SCHEMA tables.

get_tap_schema_std_path()

Get the path to the standard TAP_SCHEMA schema resource.

get_tap_schema_std_resource()

Get the standard TAP_SCHEMA schema resource.

load_schema_resource()

Load the standard TAP_SCHEMA schema from a Felis package resource into a Felis Schema.

Attributes Documentation

metadata

Get the metadata for the TAP_SCHEMA tables.

Returns:

The metadata for the TAP_SCHEMA tables.

Return type:

MetaData

schema

Get the TAP_SCHEMA schema.

Returns:

The TAP_SCHEMA schema.

Return type:

Schema

Methods Documentation

classmethod get_schema_name_std()

Get the standard schema name for the TAP_SCHEMA tables.

Returns:

The standard schema name for the TAP_SCHEMA tables.

Return type:

str

classmethod get_table_names_std()

Get the standard column names for the TAP_SCHEMA tables.

Returns:

The standard table names for the TAP_SCHEMA tables.

Return type:

list

classmethod get_tap_schema_std_path()

Get the path to the standard TAP_SCHEMA schema resource.

Returns:

The path to the standard TAP_SCHEMA schema resource.

Return type:

str

classmethod get_tap_schema_std_resource()

Get the standard TAP_SCHEMA schema resource.

Returns:

The standard TAP_SCHEMA schema resource.

Return type:

ResourcePath

classmethod load_schema_resource()

Load the standard TAP_SCHEMA schema from a Felis package resource into a Felis Schema.

Returns:

The TAP_SCHEMA schema.

Return type:

Schema