Skip to main content

Enforcement, governance, and data quality runtime for data contracts

Project description

Sraosha

Enforcement and governance runtime for YAML data contracts. Validates with datacontract-cli, exposes CLI and API enforcement, optional Soda-based database checks, cross-contract impact analysis, compliance tracking, and a self-hosted dashboard (Jinja2 + FastAPI) on the API port.

License: MIT Python 3.11+

Contents

Features

Area Notes
Contract validation YAML contracts; engine wraps datacontract-cli
Enforcement CLI, HTTP API, or embed ContractEngine
Data quality (optional) Soda Core checks per connection; install e.g. soda-core-postgres as needed
Impact Dependency graph, lineage UI (/ui/impact), GET /api/v1/impact/graph and lineage endpoints
Operations PostgreSQL persistence, Celery + Redis for schedules and compliance snapshots
UI Dashboard under /ui/*, OpenAPI at /docs

Install

pip install sraosha

Dev extras (tests, lint, types): pip install -e ".[dev]"

Quickstart

Docker Compose (API, PostgreSQL, Redis, Celery worker and beat):

cp .sraosha.example .sraosha   # edit as needed
docker compose up -d
# Dashboard: http://localhost:8000/ui/

Local CLI:

pip install sraosha
cp .sraosha.example .sraosha
sraosha serve

Config path: sraosha --config /path/to/.sraosha serve or SRAOSHA_CONFIG=/path/to/.sraosha.

Register and validate:

sraosha register --contract contracts/orders.yaml --team my-team
sraosha run --contract contracts/orders.yaml --mode block

How it works

  • Validation: sraosha run, the REST API, or ContractEngine run checks via datacontract-cli. With block mode, failures exit non-zero (CLI) or raise (library); results persist when a database is configured.
  • Background: Celery beat drives periodic jobs (compliance recompute, validation and DQ schedule polling); workers execute them. Details: ARCHITECTURE.md.
  • Data quality: Optional Soda checks are configured per connection (/api/v1/data-quality); they sit alongside contract validation.

Lineage nodes include a platform string from contract servers.*.type for display.

Architecture

  • FastAPI: JSON /api/v1/*, dashboard /ui/*.
  • PostgreSQL: Contracts, runs, teams, schedules, DQ metadata, compliance scores.
  • Redis: Celery broker; production uses one sraosha beat and one or more sraosha worker processes.
Orchestrator / CLI / API
        → ContractEngine → datacontract-cli
        → PostgreSQL
FastAPI (:8000)  +  Celery workers

More diagrams and layout: ARCHITECTURE.md.

CLI

sraosha [--config PATH] <command>

sraosha run --contract path/to/contract.yaml [--mode block|warn|log] [--server NAME]
sraosha status [--format table|json]
sraosha history --contract <contract_id> [--limit 20]
sraosha register --contract path/to/contract.yaml --team my-team
sraosha impact --contract <contract_id> --fields field_a,field_b
sraosha serve [--host 0.0.0.0] [--port 8000] [--reload]
sraosha db
sraosha worker [--loglevel info] [--concurrency 4] [--hostname worker@%h]
sraosha beat [--loglevel info]
sraosha version

One-off compliance recompute (Compose):

docker compose exec worker celery -A sraosha.tasks.celery_app call \
  sraosha.tasks.compliance_compute.compute_compliance_scores

Configuration

Dotenv-style .sraosha file. Resolution (first wins): --config, SRAOSHA_CONFIG, ./.sraosha, ~/.sraosha, then defaults. Environment variables override file values. See .sraosha.example.

Development

uv sync --extra dev    # or: python -m venv .venv && pip install -e ".[dev]"
pre-commit install
docker compose up postgres redis -d
uv run sraosha db
uv run sraosha serve --reload

Make: lint, format, test, test-cov, typecheck, dev, clean (see Makefile). Full guide: CONTRIBUTING.md.

Contributing & license

See CONTRIBUTING.md. Licensed under MIT — LICENSE.

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

sraosha-0.1.2.tar.gz (296.7 kB view details)

Uploaded Source

Built Distribution

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

sraosha-0.1.2-py3-none-any.whl (198.2 kB view details)

Uploaded Python 3

File details

Details for the file sraosha-0.1.2.tar.gz.

File metadata

  • Download URL: sraosha-0.1.2.tar.gz
  • Upload date:
  • Size: 296.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sraosha-0.1.2.tar.gz
Algorithm Hash digest
SHA256 e61832b80929c37b1b8cac0d9808a3f2b41febde5b42b6d676e80ffa059db22f
MD5 b33ef5b8a9a97f36caca3c9c6d56295d
BLAKE2b-256 0ff8e16b05e15ea72b6602e52f920ca405b3782e0fb448dbf2c99abf16bc2484

See more details on using hashes here.

Provenance

The following attestation bundles were made for sraosha-0.1.2.tar.gz:

Publisher: release.yml on daun-gatal/sraosha

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

File details

Details for the file sraosha-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: sraosha-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 198.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sraosha-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bf85ab393eaab25219f5c01bb0b5dba1f64e9778ce1a67af93e399d5d1589f4f
MD5 01a43cdf0cba9800af14fe4d7575aa48
BLAKE2b-256 7206696f9b24d875de01199b96be586d79c7f20b87a82347e74c3449997c0de0

See more details on using hashes here.

Provenance

The following attestation bundles were made for sraosha-0.1.2-py3-none-any.whl:

Publisher: release.yml on daun-gatal/sraosha

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