Skip to main content

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)

# Export with embedded metadata (for self-contained files)
json_meta = to_json(entries, schema=schema, include_meta=True)

# Load back with metadata
from aptoro import load_meta
loaded_schema, loaded_data = load_meta("output.json")

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

aptoro-0.2.0.tar.gz (39.4 kB view details)

Uploaded Source

Built Distribution

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

aptoro-0.2.0-py3-none-any.whl (34.3 kB view details)

Uploaded Python 3

File details

Details for the file aptoro-0.2.0.tar.gz.

File metadata

  • Download URL: aptoro-0.2.0.tar.gz
  • Upload date:
  • Size: 39.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for aptoro-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4d42a4a79bfa42cc91d766e642dd22a836ca0b3da89b8a64025cc10d257979a1
MD5 061d1059f59f5482fe58f1e03d5f8731
BLAKE2b-256 1d4134af4b23532dc627dfbc23289cbddb71f51f6e76632ebcadc79abb28c298

See more details on using hashes here.

File details

Details for the file aptoro-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: aptoro-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 34.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for aptoro-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6cb40b5813069897b492d27c96e259720dac3feb63c814833ec00b6fee14a8da
MD5 73aa457bb8f8658b0d3780fbb5349a09
BLAKE2b-256 02243893c698bd5c6bf86bc5253dec86d6895fefba09565c29957f5b7bbbd283

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