Python API

felis.datamodel Module

Define Pydantic data models for Felis.

Classes

BaseObject

Base model.

Column

Column model.

CheckConstraint

Table check constraint model.

Constraint

Table constraint model.

ForeignKeyConstraint

Table foreign key constraint model.

Index

Table index model.

Schema

Database schema model.

SchemaVersion

Schema version model.

Table

Table model.

UniqueConstraint

Table unique constraint model.

Class Inheritance Diagram

Inheritance diagram of felis.datamodel.BaseObject, felis.datamodel.Column, felis.datamodel.CheckConstraint, felis.datamodel.Constraint, felis.datamodel.ForeignKeyConstraint, felis.datamodel.Index, felis.datamodel.Schema, felis.datamodel.SchemaVersion, felis.datamodel.Table, felis.datamodel.UniqueConstraint

felis.diff Module

Compare schemas and print the differences.

Classes

SchemaDiff(schema1, schema2)

Compare two schemas using DeepDiff and print the differences.

DatabaseDiff(schema, engine)

Compare a schema with a database and print the differences.

felis.db.dialects Module

Get SQLAlchemy dialects and their type modules.

Functions

get_supported_dialects()

Get a dictionary of the supported SQLAlchemy dialects.

get_dialect_module(dialect_name)

Get the SQLAlchemy dialect module for the given name.

felis.db.sqltypes Module

Map Felis types to SQLAlchemy types.

Functions

boolean(**kwargs)

Get the SQL type for Felis Boolean with variants.

byte(**kwargs)

Get the SQL type for Felis Byte with variants.

short(**kwargs)

Get the SQL type for Felis Short with variants.

int(**kwargs)

Get the SQL type for Felis Int with variants.

long(**kwargs)

Get the SQL type for Felis Long with variants.

float(**kwargs)

Get the SQL type for Felis Float with variants.

double(**kwargs)

Get the SQL type for Felis Double with variants.

char(length, **kwargs)

Get the SQL type for Felis Char with variants.

string(length, **kwargs)

Get the SQL type for Felis String with variants.

unicode(length, **kwargs)

Get the SQL type for Felis Unicode with variants.

text(**kwargs)

Get the SQL type for Felis Text with variants.

binary(length, **kwargs)

Get the SQL type for Felis Binary with variants.

timestamp(**kwargs)

Get the SQL type for Felis Timestamp with variants.

get_type_func(type_name)

Find the function which creates a specific SQL type by its Felis type name.

felis.db.utils Module

Database utility functions and classes.

Functions

string_to_typeengine(type_string[, dialect, ...])

Convert a string representation of a datatype to a SQLAlchemy type.

Classes

SQLWriter([file])

Write SQL statements to stdout or a file.

ConnectionWrapper(engine)

Wrap a SQLAlchemy engine or mock connection to provide a consistent interface for executing SQL statements.

DatabaseContext(metadata, engine)

Manage the database connection and SQLAlchemy metadata.

felis.db.variants Module

Handle variant overrides for a Felis column.

Functions

make_variant_dict(column_obj)

Handle variant overrides for a felis.datamodel.Column.

felis.metadata Module

Build SQLAlchemy metadata from a Felis schema.

Functions

get_datatype_with_variants(column_obj)

Use the Felis type system to get a SQLAlchemy datatype with variant overrides from the information in a Felis column object.

Classes

MetaDataBuilder(schema[, ...])

Build a SQLAlchemy metadata object from a Felis schema.

felis.tap Module

Translate a Felis schema into a TAP_SCHEMA representation.

Functions

init_tables([tap_schema_name, ...])

Generate definitions for TAP tables.

Classes

TapLoadingVisitor(engine[, catalog_name, ...])

Generate TAP_SCHEMA data and insert it into a database using the SQLAlchemy ORM.

felis.tap_schema Module

Provides utilities for creating and populating the TAP_SCHEMA database.

Classes

TableManager([engine, schema_name, ...])

Manage creation of TAP_SCHEMA tables.

DataLoader(schema, mgr, engine[, ...])

Load data into the TAP_SCHEMA tables.

felis.tests.postgresql Module

Provides a temporary Postgresql instance for testing.

Functions

setup_postgres_test_db()

Set up a temporary Postgres database instance that can be used for testing.

Classes

TemporaryPostgresInstance(server, engine)

Wrapper for a temporary Postgres database.

felis.types Module

Define the supported Felis datatypes.

Classes

FelisType()

Base class for a representation of Felis column types.

Boolean()

Felis definition of boolean type.

Byte()

Felis definition of byte type.

Short()

Felis definition of short integer type.

Int()

Felis definition of integer type.

Long()

Felis definition of long integer type.

Float()

Felis definition of single precision floating point type.

Double()

Felis definition of double precision floating point type.

Char()

Felis definition of character type.

String()

Felis definition of string type.

Unicode()

Felis definition of unicode string type.

Text()

Felis definition of text type.

Binary()

Felis definition of binary type.

Timestamp()

Felis definition of timestamp type.

Class Inheritance Diagram

Inheritance diagram of felis.types.FelisType, felis.types.Boolean, felis.types.Byte, felis.types.Short, felis.types.Int, felis.types.Long, felis.types.Float, felis.types.Double, felis.types.Char, felis.types.String, felis.types.Unicode, felis.types.Text, felis.types.Binary, felis.types.Timestamp