Skip to main content

Adapter layer for .rost — converts any data source to canonical JSON

Project description

rost-io — Adapter layer for .rost

rost-io converts messy real-world data sources into the canonical JSON contracts that the .rost compiler and solver consume.

Design principle

The .rost compiler only reads canonical JSON. It has no database drivers, no Excel parser, no API calls. rost-io is the adapter layer that handles all of that — exactly as described in DATA_IO.md (Hexagonal Architecture).

Excel / CSV / Parquet / PostgreSQL / MySQL / PDF
        │
        ▼
  rost-io adapter        ← this package
        │
        │   staff.json        (schema: rost/staff/v1)
        │   leave.json        (schema: rost/leave/v1)
        │   calendar.json     (schema: rost/calendar/v1)
        ▼
  rostc compiler  →  solver  →  solution.json

Installation

# Core only (CSV + JSON — no extra dependencies)
pip install rost-io

# With Parquet support (P1)
pip install "rost-io[parquet]"

# With database support — PostgreSQL + MySQL (P1)
pip install "rost-io[db]"

# With Excel support (P2)
pip install "rost-io[excel]"

# With pandas support (P2)
pip install "rost-io[pandas]"

# Everything
pip install "rost-io[all]"

Quick start

from rost_io import CsvAdapter, validate_staff

# Convert a CSV staff export to canonical staff.json
adapter = CsvAdapter("hr_export.csv", id_col="employee_id", tags_col="roles")
staff_json = adapter.to_staff_json()

# Validate against the canonical schema
validate_staff(staff_json)          # raises jsonschema.ValidationError if invalid

# Write for the compiler
import json
with open("staff.json", "w") as f:
    json.dump(staff_json, f, indent=2)

Canonical JSON schemas

File Schema ID Description
staff.json rost/staff/v1 People + tags
leave.json rost/leave/v1 Leave/absence entries
calendar.json rost/calendar/v1 Date range + public holidays
solution.json rost/solution/v1 Solver output (read-only for rost-io)

Adapters

Adapter Priority Extra dep
CsvAdapter P0 none (stdlib)
JsonAdapter P0 none
ParquetAdapter P1 pyarrow
DatabaseAdapter P1 sqlalchemy
ExcelAdapter P2 openpyxl
PandasAdapter P2 pandas

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

rost_io-0.1.1.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

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

rost_io-0.1.1-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

Details for the file rost_io-0.1.1.tar.gz.

File metadata

  • Download URL: rost_io-0.1.1.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rost_io-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c394b7657aab2412d68648b6248cf6f177fb139712b6de63a3a90e733911c42a
MD5 109fd28a139979de1259b0a3be8dd9ce
BLAKE2b-256 75411d91610a30872defba684f6371964ffc8d705abfe2ea8cde6fda5e90e3f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for rost_io-0.1.1.tar.gz:

Publisher: release.yml on Bpi031/rost

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file rost_io-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: rost_io-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for rost_io-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3f4a95abbe1b7b2a1dad25f2456087707704a90ac7f3fb8aa14d82ce5f3a4a73
MD5 e3015700598bec9bafe76b747898bd9e
BLAKE2b-256 19a3ba8cf5ff5b12671bd7d495ac2ec61767072cdf3a98210f86819d4f0f09a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for rost_io-0.1.1-py3-none-any.whl:

Publisher: release.yml on Bpi031/rost

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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