hydra.tabular module

A simple, untyped tabular data model, suitable for CSVs and TSVs.

class hydra.tabular.ColumnType(name: ColumnName, type: Type)

Bases: object

A column type, consisting of a name and a value type.

class Builder(_name: 'hydra.relational.ColumnName' = None, _type: 'hydra.core.Type' = None)

Bases: object

build()
name(name)
type(type)
NAME = Name(value='name')
TYPE = Name(value='type')
TYPE_ = Name(value='hydra.tabular.ColumnType')
static builder()
name: ColumnName
type: Type
with_name(name)
with_type(type)
class hydra.tabular.DataRow(value: T)

Bases: Node[Sequence[Optional[V]]], Generic[V]

A data row, containing optional-valued cells; one per column.

TYPE_ = Name(value='hydra.tabular.DataRow')
class hydra.tabular.HeaderRow(value: T)

Bases: Node[Sequence[str]]

A header row, containing column names (but no types or data).

TYPE_ = Name(value='hydra.tabular.HeaderRow')
class hydra.tabular.Table(header: Annotated[object, 'The optional header row of the table. If present, the header must have the same number of cells as each data row.'], data: Annotated[Sequence[DataRow[V]], 'The data rows of the table. Each row must have the same number of cells.'])

Bases: Generic[V]

A simple table as in a CSV file, having an optional header row and any number of data rows.

class Builder(_header: 'Optional[HeaderRow]' = None, _data: 'Sequence[DataRow[V]]' = None)

Bases: Generic[V]

build()
data(data)
header(header)
DATA = Name(value='data')
HEADER = Name(value='header')
TYPE_ = Name(value='hydra.tabular.Table')
static builder()
data: Annotated[Sequence[DataRow[V]], 'The data rows of the table. Each row must have the same number of cells.']
header: Annotated[object, 'The optional header row of the table. If present, the header must have the same number of cells as each data row.']
with_data(data)
with_header(header)
class hydra.tabular.TableType(name: RelationName, columns: Sequence[ColumnType])

Bases: object

A type definition for a table, including column names and types.

class Builder(_name: 'hydra.relational.RelationName' = None, _columns: 'Sequence[ColumnType]' = None)

Bases: object

build()
columns(columns)
name(name)
COLUMNS = Name(value='columns')
NAME = Name(value='name')
TYPE_ = Name(value='hydra.tabular.TableType')
static builder()
columns: Sequence[ColumnType]
name: RelationName
with_columns(columns)
with_name(name)