app.core package

Submodules

app.core.celery_client module

class CeleryClient[source]

Bases: object

__init__()[source]

Init class variables needed to establish a connection to the database

get_app()[source]
get_result(task_id: str)[source]
get_status(task_id: str)[source]
get_task(name: str, queue, *args, **kwargs)[source]

app.core.data_factory module

class DataFactory[source]

Bases: object

static from_bytes(filename: str, file_bytes: bytes) pandas.DataFrame | None[source]

Create a pandas DataFrame from file bytes based on file extension.

Supports CSV, Excel, JSON, and Parquet formats.

Parameters:
  • filename – Original filename (used for format detection)

  • file_bytes – File content in bytes

Returns:

Pandas DataFrame or None if unsupported file format provided.

static from_dict(d: Dict) pandas.DataFrame | None[source]
static merge_dfs(*args) pandas.DataFrame[source]

app.core.dvc_client module

class DVCClient[source]

Bases: object

Handles DVC operations with S3-like remote, using temporary files.

__init__() None[source]
read_data_from(source: str, bucket_name=None) Any | None[source]

Reads an object from a S3 bucket

Parameters:
  • source (str) – Path under the object is available.

  • bucket_name (str, optional) – Bucket name to upload to. Defaults to None. If not provided, a default name from the environment space will be used.

Returns:

Downloaded (python) object.

Return type:

Union[Any, None]

save_data_to(obj: Any, destination: str, bucket_name=None) bool[source]

Upload an object to a S3 bucket

Parameters:
  • obj (Any) – Object to upload.

  • bucket_name (str, optional) – Bucket name to upload to. Defaults to None. If not provided, a default name from the environment space will be used.

  • destination (str) – Location under the object should be saved.

Returns:

True if file was uploaded, else False.

Return type:

bool

Module contents