A minimal, functional Python ETL library for reading, validating, and transforming data using YAML schemas
Project description
Aptoro
Aptoro is a Xavante word for "preparing the arrows for hunting".
A minimal, functional Python ETL library for reading, validating, and transforming data using YAML schemas.
Installation
pip install aptoro
Quick Start
from aptoro import load, load_schema, read, validate, to_json
# All-in-one: read + validate
entries = load(source="data.csv", schema="schema.yaml")
# Or step by step:
schema = load_schema("schema.yaml")
data = read("data.csv")
entries = validate(data, schema)
# Export
json_str = to_json(entries)
Schema Language
Define your data schema in YAML:
name: lexicon_entry
description: Dictionary entries
fields:
id: str
lemma: str
pos: str[noun|verb|adj|adv] # Constrained values
definition: str
translation: str? # Optional field
examples: list[str]? # Optional list
frequency: int = 0 # Default value
Type Syntax
- Basic types:
str,int,float,bool - Optional:
str? - Default value:
str = "default",int = 0 - Constrained:
str[a|b|c] - Lists:
list[str],list[int]
Schema Inheritance
# child.yaml
name: child_entry
extends: base.yaml
fields:
name: str
# inherits fields from base.yaml
Supported Formats
- CSV
- JSON
- YAML
- TOML
License
GNU General Public License v3 (GPLv3)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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 aptoro-0.1.0.tar.gz.
File metadata
- Download URL: aptoro-0.1.0.tar.gz
- Upload date:
- Size: 35.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ea5f1d567575741851f42cf4472f5e6fa1069e63ab446ac437d4907c62ca493
|
|
| MD5 |
d596af9f5734aaaa42dd88330972db24
|
|
| BLAKE2b-256 |
10fbac40dc4428e3a7dd6c9edf70752b3f69cf179a9dc7b508e1ce2ebccb2300
|
File details
Details for the file aptoro-0.1.0-py3-none-any.whl.
File metadata
- Download URL: aptoro-0.1.0-py3-none-any.whl
- Upload date:
- Size: 32.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
621b0410b9fb73b5a206a79bfcd34d713383fa474225d7905030533acd4cb092
|
|
| MD5 |
b907430173b07f1b199d0bd5fefcad48
|
|
| BLAKE2b-256 |
c3a3a6690c0c6255df4311f0ab59f14d41773c8980764ee0ce2baa820721cf25
|