Skip to content

Schema

PrimaryKey

Primary key

ForeignKey

ForeignKey(parent: str)

Foreign key of a relational dataset, namely a relation between two tables.

Parameters:

Name Type Description Default
parent str

Parent table (table to which the key refers to).

required

Column

Enumeration of column types.

Attributes:

Name Type Description
TEXT

A column containing free text.

CATEGORICAL

A column containing a categorical variable.

BOOLEAN

A column containing boolean values.

NUMERIC

A column containing numeric values.

INTEGER

A column containing integer values.

DATETIME

A column containing date-time values.

DATE

A column containing dates.

TIME

A column containing time values.

COORDINATES

A column containing geographic coordinates.

ITAFISCALCODE

A column containing italian fiscal codes (codice fiscale).

Table

Table(
    columns: dict[str, Column | ForeignKey | PrimaryKey]
    | None = None,
    **kwargs: Column | ForeignKey | PrimaryKey,
)

Class representing a table in a relational dataset.

Parameters:

Name Type Description Default
columns dict[str, Column | ForeignKey | PrimaryKey] | None

Dictionary mapping each feature column to a Column object and each foreign key column to a ForeignKey object. A single optional PrimaryKey may be specified.

None
**kwargs Column | ForeignKey | PrimaryKey

Additional Column, PrimaryKey or ForeignKey objects.

{}

Schema

Schema(
    tables: dict[str, Table] | None = None, **kwargs: Table
)

Schema of a relational dataset.

Parameters:

Name Type Description Default
tables dict[str, Table] | None

Dictionary associating each data table to a Table object. Tables will be reordered to allow traversing from the graph roots to its leaves.

None
**kwargs Table

Additional Table objects.

{}