Skip to main content

Data management model for the Algomancy library

Project description

algomancy-data

Data layer for Algomancy dashboards: schemas, extract/transform/load (ETL) primitives, validators, and data containers used by the GUI and scenario packages.

Features

  • DataSource and BaseDataSource containers with table management and JSON (de)serialization
  • Pluggable ETL pipeline building blocks: Extractor, Transformer, Validator, Loader
  • DataManager orchestrators (stateful/stateless) to drive ETL and manage datasets
  • Declarative InputFileConfiguration for file inputs (CSV, XLSX, JSON)

Installation

pip install -e packages/algomancy-data

Requires Python >= 3.14. Core dependency: pandas.

Quick start: use DataSource directly

import pandas as pd
from algomancy_data import DataSource, DataClassification

ds = DataSource(ds_type=DataClassification.MASTER_DATA, name="warehouse")
ds.add_table("inventory", pd.DataFrame({"sku": ["A", "B"], "qty": [10, 5]}))

# JSON roundtrip
json_str = ds.to_json()
ds2 = DataSource.from_json(json_str)
assert ds2.get_table("inventory").equals(ds.get_table("inventory"))

Quick start: orchestrate ETL with a DataManager

DataManager wires ExtractorTransformerValidatorLoader. You provide an ETLFactory that builds these parts for each input configuration.

from typing import List
from algomancy_data import (
    DataSource, DataClassification,
    DataManager, StatelessDataManager, ETLFactory,
    SingleInputFileConfiguration, FileExtension
)

class MyETLFactory(ETLFactory):
    # Implement factory methods to build Extractor/Transformer/Validator/Loader
    ...

input_cfgs: List[SingleInputFileConfiguration] = [
    SingleInputFileConfiguration(
        tag="inventory", file_name="inventory", extension=FileExtension.CSV
    )
]

dm: DataManager = StatelessDataManager(
    etl_factory=MyETLFactory,
    input_configs=input_cfgs,
    save_type="json",  # or other configured type
    data_object_type=DataSource,
)

files = dm.prepare_files(file_items_with_path=[("inventory", "./data/inventory.csv")])
ds: DataSource = dm.etl_data(files=files, dataset_name="warehouse")

Documentation and examples

  • Root docs: documentation/1_data.md
  • End‑to‑end usage in the example app: example/ (see example/data_handling and example/main.py)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

algomancy_data-0.3.12-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file algomancy_data-0.3.12-py3-none-any.whl.

File metadata

  • Download URL: algomancy_data-0.3.12-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.28 {"installer":{"name":"uv","version":"0.9.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for algomancy_data-0.3.12-py3-none-any.whl
Algorithm Hash digest
SHA256 5275f3280eab5a1d993d6fbd3436b30078fe7749c99785dddad04c5f9072741f
MD5 ef0298ebeb3d87de2ddc294052624b0e
BLAKE2b-256 8913c3dad524b94892aad0699c4cb11ef2090d19b4344832873aba13503e72aa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page