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
DataSourceandBaseDataSourcecontainers with table management and JSON (de)serialization- Pluggable ETL pipeline building blocks:
Extractor,Transformer,Validator,Loader DataManagerorchestrators (stateful/stateless) to drive ETL and manage datasets- Declarative
InputFileConfigurationfor 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 Extractor → Transformer → Validator → Loader. 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/(seeexample/data_handlingandexample/main.py)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file algomancy_data-0.3.16-py3-none-any.whl.
File metadata
- Download URL: algomancy_data-0.3.16-py3-none-any.whl
- Upload date:
- Size: 24.9 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e66c7f9bfbb4845a2598e3705d8e13c3f7616a7954953a23c97c9c514f719c2
|
|
| MD5 |
7adad799a3a125095486cd847c8241d6
|
|
| BLAKE2b-256 |
16b56259c5e414597e437e2c3579a69b209181d917d386226d352f32b6e86a70
|