Skip to content

Classes and constants

This page lists some classes, types and constants used in this library.

src.data_hub.dataframe.DataFrame

Bases: DataFrame

A subclass of pandas DataFrame that allows for easy updating of a Deep Origin database. This can be used as a drop-in replacement for a pandas DataFrame, and should support all methods a pandas DataFrame supports.

The primary method of creating an object of this type is to use the from_deeporigin class method.

auto_sync class-attribute instance-attribute

auto_sync: bool = False

When True, changes made to the dataframe will be automatically synced to the Deep Origin database this dataframe represents.

from_deeporigin classmethod

from_deeporigin(
    database_id: str,
    *,
    use_file_names: bool = True,
    reference_format: IDFormat = "human-id",
    filter: Optional[dict] = None,
    client=None
)

Create a local Deep Origin DataFrame from a Deep Origin database.

Parameters:

Name Type Description Default
database_id str

The ID of the Deep Origin database.

required
use_file_names bool

Whether to use the file names in the Deep Origin database. Defaults to True.

True
reference_format IDFormat

The format of the IDs in the Deep Origin database. Defaults to "human-id".

'human-id'

to_deeporigin

to_deeporigin()

Write data in dataframe to Deep Origin

Deep Origin DataFrames can automatically synchronize

To automatically save changes to local DataFrames to Deep Origin databases, set the auto_sync attribute of the dataframe True.

src.utils.constants

this module contains constants used in the rest of this library

Cardinality module-attribute

Cardinality = Literal['one', 'many']

The cardinality defines whether a cell in a database can contain one or multiple objects

DataType module-attribute

DataType = Literal[
    "integer",
    "select",
    "date",
    "text",
    "file",
    "reference",
    "editor",
    "float",
    "boolean",
]

Type of a column in a Deep Origin database. See this page in the documentation for more information.

DatabaseReturnType module-attribute

DatabaseReturnType = Literal['dataframe', 'dict']

Return type for api.get_dataframe

FileStatus module-attribute

FileStatus = Literal['ready', 'archived']

Status of a file. Ready files are ready to be used, downloaded, and operated on.

IDFormat module-attribute

IDFormat = Literal['human-id', 'system-id']

Format of an ID

ObjectType module-attribute

ObjectType = Literal['row', 'database', 'workspace']

Type of a row. In Deep Origin, a row can be a database row, a database or a workspace

PREFIXES dataclass

Prefixes for CLI and Python client