typeddfs._entries

Convenient code for import.

Module Contents

typeddfs._entries.affinity_matrix
typeddfs._entries.example
typeddfs._entries.matrix
typeddfs._entries.typed
typeddfs._entries.untyped
typeddfs._entries.wrap
class typeddfs._entries.FinalDf

An untyped DataFrame meant for general use.

class typeddfs._entries.TypedDfs

The only thing you need to import from typeddfs.

Contains static factory methods to build new DataFrame subclasses. In particular, see:

- :meth:`typed`
- :meth:`untyped`
- :meth:`matrix`
- :meth:`affinity_matrix`
Checksums
ClashError
CompressionFormat
FileFormat
FilenameSuffixError
FinalDf
FrozeDict
FrozeList
FrozeSet
InvalidDfError
MissingColumnError
NoValueError
NonStrColumnError
NotSingleColumnError
UnexpectedColumnError
UnexpectedIndexNameError
UnsupportedOperationError
Utils
ValueNotUniqueError
VerificationFailedError
_logger
classmethod affinity_matrix(cls, name: str, doc: Optional[str] = None) typeddfs.builders.AffinityMatrixDfBuilder

Creates a new subclass of an typeddfs.matrix_dfs.AffinityMatrixDf.

Parameters
  • name – The name that will be used for the new class

  • doc – The docstring for the new class

Returns

A builder instance (builder pattern) to be used with chained calls

classmethod example(cls) Type[typeddfs.typed_dfs.TypedDf]

Creates a new example TypedDf subclass. The class has:

  • required index β€œkey”

  • required column β€œvalue”

  • reserved column β€œnote”

  • no other columns

Returns

The created class

classmethod matrix(cls, name: str, doc: Optional[str] = None) typeddfs.builders.MatrixDfBuilder

Creates a new subclass of an typeddfs.matrix_dfs.MatrixDf.

Parameters
  • name – The name that will be used for the new class

  • doc – The docstring for the new class

Returns

A builder instance (builder pattern) to be used with chained calls

classmethod typed(cls, name: str, doc: Optional[str] = None) typeddfs.builders.TypedDfBuilder

Creates a new type with flexible requirements. The class will enforce constraints and subclass typeddfs.typed_dfs.TypedDf.

Parameters
  • name – The name that will be used for the new class

  • doc – The docstring for the new class

Returns

A builder instance (builder pattern) to be used with chained calls

Example

TypedDfs.typed("MyClass").require("name", index=True).build()

classmethod untyped(cls, name: str, doc: Optional[str] = None) Type[typeddfs.untyped_dfs.UntypedDf]

Creates a new subclass of UntypedDf. The returned class will not enforce constraints but will have some extra methods. In general typed() should be preferred because it has more consistent behavior, especially for IO.

Parameters
  • name – The name that will be used for the new class

  • doc – The docstring for the new class

Returns

A class instance

Example

MyClass = TypedDfs.untyped("MyClass")

classmethod wrap(cls, df: pandas.DataFrame) FinalDf

Just wraps a DataFrame into a simple untyped DataFrame. Useful to quickly access a function only defined on typeddfs DataFrames.

Example

TypedDfs.wrap(df).write_file("abc.feather")