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.
Contents
- Features
- Install
- Quickstart
- How it works
- Architecture
- CLI
- Configuration
- Development
- Contributing & license
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, orContractEnginerun checks viadatacontract-cli. Withblockmode, 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 beatand one or moresraosha workerprocesses.
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
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 sraosha-0.1.1.tar.gz.
File metadata
- Download URL: sraosha-0.1.1.tar.gz
- Upload date:
- Size: 299.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
997c9460293bb95ae4105e708aa569f4d1aaaa1e34584f3879783831f8e6b2f2
|
|
| MD5 |
78ced748258407fb0d19f53463ce0b90
|
|
| BLAKE2b-256 |
33502ac536ea584716000a86acd974e65091dfb44fa9ed7b6d594d3dab22f2a7
|
Provenance
The following attestation bundles were made for sraosha-0.1.1.tar.gz:
Publisher:
release.yml on daun-gatal/sraosha
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sraosha-0.1.1.tar.gz -
Subject digest:
997c9460293bb95ae4105e708aa569f4d1aaaa1e34584f3879783831f8e6b2f2 - Sigstore transparency entry: 1222422924
- Sigstore integration time:
-
Permalink:
daun-gatal/sraosha@636b5ca40e2a9d97e38bfaf4b63c4b5977f2eb1e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/daun-gatal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@636b5ca40e2a9d97e38bfaf4b63c4b5977f2eb1e -
Trigger Event:
push
-
Statement type:
File details
Details for the file sraosha-0.1.1-py3-none-any.whl.
File metadata
- Download URL: sraosha-0.1.1-py3-none-any.whl
- Upload date:
- Size: 194.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c4c521100693c4cd84e52617c1faa611952c8eb7139bfcbe51c8827ce1d72e3
|
|
| MD5 |
cb435b480ee980b44690a42e52e18cc3
|
|
| BLAKE2b-256 |
89d1029e6df532f08844ca2fa44b946e834931ba9a7cfeb484d6e6d72f9b0936
|
Provenance
The following attestation bundles were made for sraosha-0.1.1-py3-none-any.whl:
Publisher:
release.yml on daun-gatal/sraosha
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sraosha-0.1.1-py3-none-any.whl -
Subject digest:
3c4c521100693c4cd84e52617c1faa611952c8eb7139bfcbe51c8827ce1d72e3 - Sigstore transparency entry: 1222422995
- Sigstore integration time:
-
Permalink:
daun-gatal/sraosha@636b5ca40e2a9d97e38bfaf4b63c4b5977f2eb1e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/daun-gatal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@636b5ca40e2a9d97e38bfaf4b63c4b5977f2eb1e -
Trigger Event:
push
-
Statement type: