datavow 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- datavow-0.1.0/.github/workflows/ci.yml +49 -0
- datavow-0.1.0/.github/workflows/publish.yml +50 -0
- datavow-0.1.0/.gitignore +15 -0
- datavow-0.1.0/CHANGELOG.md +23 -0
- datavow-0.1.0/CLAUDE.md +52 -0
- datavow-0.1.0/LICENSE +190 -0
- datavow-0.1.0/PKG-INFO +290 -0
- datavow-0.1.0/README.md +257 -0
- datavow-0.1.0/examples/github-action.yml +55 -0
- datavow-0.1.0/publish.yml +50 -0
- datavow-0.1.0/pyproject.toml +54 -0
- datavow-0.1.0/src/datavow/__init__.py +3 -0
- datavow-0.1.0/src/datavow/cli.py +557 -0
- datavow-0.1.0/src/datavow/connectors/__init__.py +1 -0
- datavow-0.1.0/src/datavow/connectors/file.py +36 -0
- datavow-0.1.0/src/datavow/contract.py +220 -0
- datavow-0.1.0/src/datavow/findings.py +104 -0
- datavow-0.1.0/src/datavow/reporter.py +92 -0
- datavow-0.1.0/src/datavow/rules/__init__.py +1 -0
- datavow-0.1.0/src/datavow/rules/freshness.py +115 -0
- datavow-0.1.0/src/datavow/rules/quality.py +212 -0
- datavow-0.1.0/src/datavow/rules/schema.py +207 -0
- datavow-0.1.0/src/datavow/templates/report.html.j2 +373 -0
- datavow-0.1.0/src/datavow/templates/report.md.j2 +59 -0
- datavow-0.1.0/src/datavow/validator.py +39 -0
- datavow-0.1.0/tests/fixtures/customers_contract.yaml +29 -0
- datavow-0.1.0/tests/fixtures/orders_clean.csv +6 -0
- datavow-0.1.0/tests/fixtures/orders_contract.yaml +56 -0
- datavow-0.1.0/tests/fixtures/orders_dirty.csv +6 -0
- datavow-0.1.0/tests/test_cli.py +30 -0
- datavow-0.1.0/tests/test_define_ci.py +164 -0
- datavow-0.1.0/tests/test_reporter.py +189 -0
- datavow-0.1.0/tests/test_validate.py +230 -0
- datavow-0.1.0/uv.lock +566 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ["3.12", "3.13"]
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
|
|
19
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
20
|
+
uses: actions/setup-python@v5
|
|
21
|
+
with:
|
|
22
|
+
python-version: ${{ matrix.python-version }}
|
|
23
|
+
|
|
24
|
+
- name: Install dependencies
|
|
25
|
+
run: |
|
|
26
|
+
python -m pip install --upgrade pip
|
|
27
|
+
pip install -e '.[dev]'
|
|
28
|
+
|
|
29
|
+
- name: Lint
|
|
30
|
+
run: ruff check src/ tests/
|
|
31
|
+
|
|
32
|
+
- name: Test
|
|
33
|
+
run: pytest tests/ -v --tb=short
|
|
34
|
+
|
|
35
|
+
lint-format:
|
|
36
|
+
runs-on: ubuntu-latest
|
|
37
|
+
steps:
|
|
38
|
+
- uses: actions/checkout@v4
|
|
39
|
+
|
|
40
|
+
- name: Set up Python
|
|
41
|
+
uses: actions/setup-python@v5
|
|
42
|
+
with:
|
|
43
|
+
python-version: "3.12"
|
|
44
|
+
|
|
45
|
+
- name: Install ruff
|
|
46
|
+
run: pip install ruff
|
|
47
|
+
|
|
48
|
+
- name: Check formatting
|
|
49
|
+
run: ruff format --check src/ tests/
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
id-token: write # Required for Trusted Publisher (OIDC)
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
|
|
16
|
+
- name: Set up Python
|
|
17
|
+
uses: actions/setup-python@v5
|
|
18
|
+
with:
|
|
19
|
+
python-version: "3.12"
|
|
20
|
+
|
|
21
|
+
- name: Install build tools
|
|
22
|
+
run: pip install hatchling build
|
|
23
|
+
|
|
24
|
+
- name: Build package
|
|
25
|
+
run: python -m build
|
|
26
|
+
|
|
27
|
+
- name: Verify package
|
|
28
|
+
run: |
|
|
29
|
+
pip install dist/*.whl
|
|
30
|
+
datavow --version
|
|
31
|
+
|
|
32
|
+
- uses: actions/upload-artifact@v4
|
|
33
|
+
with:
|
|
34
|
+
name: dist
|
|
35
|
+
path: dist/
|
|
36
|
+
|
|
37
|
+
publish:
|
|
38
|
+
needs: build
|
|
39
|
+
runs-on: ubuntu-latest
|
|
40
|
+
environment: pypi
|
|
41
|
+
permissions:
|
|
42
|
+
id-token: write
|
|
43
|
+
steps:
|
|
44
|
+
- uses: actions/download-artifact@v4
|
|
45
|
+
with:
|
|
46
|
+
name: dist
|
|
47
|
+
path: dist/
|
|
48
|
+
|
|
49
|
+
- name: Publish to PyPI
|
|
50
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
datavow-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to DataVow will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.1.0] - 2026-03-06
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **CLI commands**: `init`, `define`, `validate`, `report`, `ci`
|
|
13
|
+
- **Contract format**: YAML-based, ODCS v3.1 superset with metadata, schema, quality rules, SLA
|
|
14
|
+
- **Validation engine**: DuckDB-based validation for schema, quality, and freshness checks
|
|
15
|
+
- **Rule types**: `not_null`, `unique`, `row_count`, `range`, `pattern`, `sql`, `freshness`
|
|
16
|
+
- **Severity levels**: CRITICAL (blocks), WARNING (alerts), INFO (logs)
|
|
17
|
+
- **Vow Score**: 0-100 scoring with verdicts (Kept / Strained / Broken / Shattered)
|
|
18
|
+
- **Reports**: HTML (self-contained, branded) and Markdown output
|
|
19
|
+
- **CI mode**: `datavow ci` with exit code 0/1 for pipeline integration
|
|
20
|
+
- **Data sources**: CSV, Parquet, JSON, JSONL, TSV via DuckDB
|
|
21
|
+
- **GitHub Actions CI**: automated tests on Python 3.12 and 3.13
|
|
22
|
+
|
|
23
|
+
[0.1.0]: https://github.com/ludovicschmetz-stack/datavow/releases/tag/v0.1.0
|
datavow-0.1.0/CLAUDE.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# DataVow — Development Guide
|
|
2
|
+
|
|
3
|
+
## Project layout
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
src/datavow/
|
|
7
|
+
├── __init__.py # version
|
|
8
|
+
├── cli.py # Typer CLI (init, define, validate, report, ci)
|
|
9
|
+
├── contract.py # Pydantic models for YAML contract parsing
|
|
10
|
+
├── findings.py # Finding, ValidationResult, Verdict, scoring
|
|
11
|
+
├── validator.py # Orchestrates schema + quality + freshness checks
|
|
12
|
+
├── reporter.py # Jinja2-based HTML/Markdown report generation
|
|
13
|
+
├── connectors/
|
|
14
|
+
│ └── file.py # CSV/Parquet/JSON loader via DuckDB
|
|
15
|
+
├── rules/
|
|
16
|
+
│ ├── schema.py # Field existence, type, required, unique, pattern, range
|
|
17
|
+
│ ├── quality.py # SQL, not_null, unique, row_count, range, regex rules
|
|
18
|
+
│ └── freshness.py # SLA freshness checks on timestamp fields
|
|
19
|
+
└── templates/
|
|
20
|
+
├── report.html.j2 # Self-contained HTML report template
|
|
21
|
+
└── report.md.j2 # Markdown report template
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Commands
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pip install -e '.[dev]'
|
|
28
|
+
pytest tests/ -v # 77 tests expected
|
|
29
|
+
ruff check src/ tests/ # lint
|
|
30
|
+
ruff format src/ tests/ # format
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Conventions
|
|
34
|
+
|
|
35
|
+
- Python >=3.12, use modern syntax (`X | Y` unions, `match`, `Annotated`)
|
|
36
|
+
- CLI commands in `src/datavow/cli.py` using Typer + Rich
|
|
37
|
+
- Contract parsing via Pydantic v2 — all validation in models
|
|
38
|
+
- Data validation via DuckDB SQL — no pandas/polars
|
|
39
|
+
- Tests use pytest; `tmp_path` and `monkeypatch.chdir` for filesystem tests
|
|
40
|
+
- Scoring: `100 - (20×CRITICAL + 5×WARNING + 1×INFO)`, floor 0
|
|
41
|
+
- Severity: CRITICAL (blocks CI), WARNING (alerts), INFO (logs)
|
|
42
|
+
- Contract format: superset of ODCS v3.1
|
|
43
|
+
|
|
44
|
+
## Architecture decisions
|
|
45
|
+
|
|
46
|
+
See `datavow-decisions-log.md` in the project instructions for full decision log (D001–D017).
|
|
47
|
+
|
|
48
|
+
Key decisions:
|
|
49
|
+
- D005: DuckDB as validation engine (reads Parquet/CSV/JSON natively)
|
|
50
|
+
- D004: ODCS v3.1 superset (compatible but extended)
|
|
51
|
+
- D006: Vow Score formula aligned with Olympus
|
|
52
|
+
- D007: Apache 2.0 license (max adoption, SaaS monetization later)
|
datavow-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to the Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by the Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding any notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
Copyright 2025 datavow contributors
|
|
179
|
+
|
|
180
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
|
+
you may not use this file except in compliance with the License.
|
|
182
|
+
You may obtain a copy of the License at
|
|
183
|
+
|
|
184
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
+
|
|
186
|
+
Unless required by applicable law or agreed to in writing, software
|
|
187
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
188
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
+
See the License for the specific language governing permissions and
|
|
190
|
+
limitations under the License.
|
datavow-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: datavow
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A solemn vow on your data. From YAML to verdict.
|
|
5
|
+
Project-URL: Homepage, https://github.com/ludovicschmetz-stack/datavow
|
|
6
|
+
Project-URL: Repository, https://github.com/ludovicschmetz-stack/datavow
|
|
7
|
+
Project-URL: Issues, https://github.com/ludovicschmetz-stack/datavow/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/ludovicschmetz-stack/datavow/blob/main/CHANGELOG.md
|
|
9
|
+
Author: Ludovic Schmetz
|
|
10
|
+
License-Expression: Apache-2.0
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: data-contracts,data-quality,duckdb,odcs,validation
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Topic :: Database
|
|
19
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
20
|
+
Classifier: Typing :: Typed
|
|
21
|
+
Requires-Python: >=3.12
|
|
22
|
+
Requires-Dist: duckdb>=1.0
|
|
23
|
+
Requires-Dist: jinja2>=3.1
|
|
24
|
+
Requires-Dist: pydantic>=2.0
|
|
25
|
+
Requires-Dist: pyyaml>=6.0
|
|
26
|
+
Requires-Dist: rich>=13.0
|
|
27
|
+
Requires-Dist: typer>=0.12
|
|
28
|
+
Provides-Extra: dev
|
|
29
|
+
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
|
|
30
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
31
|
+
Requires-Dist: ruff>=0.4; extra == 'dev'
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+
<div align="center">
|
|
35
|
+
|
|
36
|
+
# DataVow
|
|
37
|
+
|
|
38
|
+
**A solemn vow on your data. From YAML to verdict.**
|
|
39
|
+
|
|
40
|
+
Data contract enforcement for modern data teams.
|
|
41
|
+
Define contracts in YAML. Validate with DuckDB. Block in CI. Report for stakeholders.
|
|
42
|
+
|
|
43
|
+
[](LICENSE)
|
|
44
|
+
[](https://python.org)
|
|
45
|
+
[](#)
|
|
46
|
+
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Why DataVow?
|
|
52
|
+
|
|
53
|
+
89% of data teams report pain points with data modeling and ownership. Data contracts are the answer — but the tooling is fragmented:
|
|
54
|
+
|
|
55
|
+
- **dbt tests**: SQL-only, no formal contract, no pre-ingestion validation
|
|
56
|
+
- **Great Expectations**: verbose Python, steep learning curve
|
|
57
|
+
- **Soda**: good YAML checks, but no CI-native workflow or stakeholder reporting
|
|
58
|
+
- **ODCS v3.1**: promising standard, but no complete implementation
|
|
59
|
+
|
|
60
|
+
**DataVow fills the gap**: one tool from contract definition to validation, CI blocking, and human-readable reports. Built on [ODCS v3.1](https://bitol.io/open-data-contract-standard/) and powered by [DuckDB](https://duckdb.org/).
|
|
61
|
+
|
|
62
|
+
## Install
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pip install datavow
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Quick start
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# 1. Scaffold a project
|
|
72
|
+
datavow init my-project
|
|
73
|
+
|
|
74
|
+
# 2. Write a contract (or edit the example)
|
|
75
|
+
cat contracts/orders.yaml
|
|
76
|
+
|
|
77
|
+
# 3. Validate data against the contract
|
|
78
|
+
datavow validate contracts/orders.yaml data/orders.csv
|
|
79
|
+
|
|
80
|
+
# 4. Generate a stakeholder report
|
|
81
|
+
datavow report contracts/orders.yaml data/orders.csv
|
|
82
|
+
|
|
83
|
+
# 5. Run in CI — exit 1 on critical failures
|
|
84
|
+
datavow ci contracts/ data/
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Commands
|
|
88
|
+
|
|
89
|
+
### `datavow init [project-name]`
|
|
90
|
+
|
|
91
|
+
Scaffold a new project with a `datavow.yaml` config and a `contracts/` directory.
|
|
92
|
+
|
|
93
|
+
### `datavow define <contract.yaml>`
|
|
94
|
+
|
|
95
|
+
Validate a contract's YAML syntax and display its structure — fields, rules, SLA — without needing data.
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
✓ Contract orders is valid
|
|
99
|
+
|
|
100
|
+
Name orders
|
|
101
|
+
Version 1.0.0
|
|
102
|
+
Domain sales
|
|
103
|
+
Owner data-team@company.com
|
|
104
|
+
|
|
105
|
+
Schema: 5 fields (5 required, 1 PII)
|
|
106
|
+
• order_id integer (required, unique)
|
|
107
|
+
• customer_email string (required, pii)
|
|
108
|
+
• total_amount decimal (required)
|
|
109
|
+
• status string (required)
|
|
110
|
+
• created_at timestamp (required)
|
|
111
|
+
|
|
112
|
+
Quality rules: 3
|
|
113
|
+
• no_negative_totals CRITICAL (sql)
|
|
114
|
+
• email_not_null CRITICAL (not_null)
|
|
115
|
+
• daily_volume WARNING (row_count)
|
|
116
|
+
|
|
117
|
+
SLA: freshness=24h, completeness=99.5%
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### `datavow validate <contract.yaml> <source>`
|
|
121
|
+
|
|
122
|
+
Run schema, quality, and freshness checks against a data source (CSV, Parquet, JSON).
|
|
123
|
+
|
|
124
|
+
```
|
|
125
|
+
datavow validate contracts/orders.yaml data/orders.csv --verbose
|
|
126
|
+
datavow validate contracts/orders.yaml data/orders.csv --ci # exit 1 on CRITICAL
|
|
127
|
+
datavow validate contracts/orders.yaml data/orders.csv -o json # JSON output
|
|
128
|
+
datavow validate contracts/orders.yaml data/orders.csv -o summary # one-liner
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### `datavow report <contract.yaml> <source>`
|
|
132
|
+
|
|
133
|
+
Generate a self-contained HTML or Markdown report. Share it with stakeholders, attach to deliveries, or publish.
|
|
134
|
+
|
|
135
|
+
```
|
|
136
|
+
datavow report contracts/orders.yaml data/orders.csv # HTML (default)
|
|
137
|
+
datavow report contracts/orders.yaml data/orders.csv -f md # Markdown
|
|
138
|
+
datavow report contracts/orders.yaml data/orders.csv -o my-report.html # custom path
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### `datavow ci <contracts_dir> <sources_dir>`
|
|
142
|
+
|
|
143
|
+
Batch-validate all contracts against matching data sources. Matches by name convention: `contracts/orders.yaml` → `sources/orders.csv`.
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
datavow ci contracts/ data/ # exit 1 on CRITICAL
|
|
147
|
+
datavow ci contracts/ data/ --fail-on warning # stricter: fail on WARNING too
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Contract format
|
|
151
|
+
|
|
152
|
+
DataVow contracts are a superset of [ODCS v3.1](https://bitol.io/open-data-contract-standard/) — compatible but extended with severity, SLA, and PII flags.
|
|
153
|
+
|
|
154
|
+
```yaml
|
|
155
|
+
apiVersion: datavow/v1
|
|
156
|
+
kind: DataContract
|
|
157
|
+
metadata:
|
|
158
|
+
name: orders
|
|
159
|
+
version: 1.0.0
|
|
160
|
+
owner: data-team@company.com
|
|
161
|
+
domain: sales
|
|
162
|
+
description: "Customer orders from the e-commerce platform"
|
|
163
|
+
tags: [pii, financial, critical]
|
|
164
|
+
|
|
165
|
+
schema:
|
|
166
|
+
type: table
|
|
167
|
+
fields:
|
|
168
|
+
- name: order_id
|
|
169
|
+
type: integer
|
|
170
|
+
required: true
|
|
171
|
+
unique: true
|
|
172
|
+
- name: customer_email
|
|
173
|
+
type: string
|
|
174
|
+
required: true
|
|
175
|
+
pii: true
|
|
176
|
+
pattern: "^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$"
|
|
177
|
+
- name: total_amount
|
|
178
|
+
type: decimal
|
|
179
|
+
required: true
|
|
180
|
+
min: 0
|
|
181
|
+
- name: status
|
|
182
|
+
type: string
|
|
183
|
+
required: true
|
|
184
|
+
allowed_values: [pending, confirmed, shipped, delivered, cancelled]
|
|
185
|
+
- name: created_at
|
|
186
|
+
type: timestamp
|
|
187
|
+
required: true
|
|
188
|
+
|
|
189
|
+
quality:
|
|
190
|
+
rules:
|
|
191
|
+
- name: no_negative_totals
|
|
192
|
+
type: sql
|
|
193
|
+
query: "SELECT COUNT(*) FROM {table} WHERE total_amount < 0"
|
|
194
|
+
threshold: 0
|
|
195
|
+
severity: CRITICAL
|
|
196
|
+
- name: email_not_null
|
|
197
|
+
type: not_null
|
|
198
|
+
field: customer_email
|
|
199
|
+
severity: CRITICAL
|
|
200
|
+
- name: daily_volume
|
|
201
|
+
type: row_count
|
|
202
|
+
min: 1000
|
|
203
|
+
max: 100000
|
|
204
|
+
severity: WARNING
|
|
205
|
+
|
|
206
|
+
sla:
|
|
207
|
+
freshness: 24h
|
|
208
|
+
completeness: "99.5%"
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Supported field types
|
|
212
|
+
|
|
213
|
+
`string`, `integer`, `float`, `decimal`, `boolean`, `date`, `timestamp`
|
|
214
|
+
|
|
215
|
+
### Supported quality rule types
|
|
216
|
+
|
|
217
|
+
| Type | Description | Required fields |
|
|
218
|
+
|------|-------------|-----------------|
|
|
219
|
+
| `sql` | Custom SQL query returning a count | `query`, `threshold` |
|
|
220
|
+
| `not_null` | Field has no nulls | `field` |
|
|
221
|
+
| `unique` | Field values are unique | `field` |
|
|
222
|
+
| `row_count` | Row count within bounds | `min`, `max` |
|
|
223
|
+
| `range` | Field values within bounds | `field`, `min_value`, `max_value` |
|
|
224
|
+
| `accepted_values` | Field values in allowed set | `field`, `values` |
|
|
225
|
+
| `regex` | Field values match pattern | `field`, `pattern` |
|
|
226
|
+
|
|
227
|
+
### Severity levels
|
|
228
|
+
|
|
229
|
+
Each rule has a severity: `CRITICAL`, `WARNING`, or `INFO`.
|
|
230
|
+
|
|
231
|
+
## Vow Score
|
|
232
|
+
|
|
233
|
+
```
|
|
234
|
+
Score = 100 - (20 × CRITICAL + 5 × WARNING + 1 × INFO)
|
|
235
|
+
|
|
236
|
+
95-100 ✅ Vow Kept — fully compliant
|
|
237
|
+
80-94 ⚠️ Vow Strained — action needed
|
|
238
|
+
50-79 🔧 Vow Broken — blocking issues
|
|
239
|
+
0-49 ❌ Vow Shattered — critical violations
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## Data Mesh ready
|
|
243
|
+
|
|
244
|
+
Contracts are organized by domain. Each contract has a `metadata.domain` field. Structure your repo naturally:
|
|
245
|
+
|
|
246
|
+
```
|
|
247
|
+
contracts/
|
|
248
|
+
├── sales/
|
|
249
|
+
│ ├── orders.yaml
|
|
250
|
+
│ └── invoices.yaml
|
|
251
|
+
├── logistics/
|
|
252
|
+
│ └── shipments.yaml
|
|
253
|
+
└── finance/
|
|
254
|
+
└── transactions.yaml
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
## Tech stack
|
|
258
|
+
|
|
259
|
+
| Component | Technology |
|
|
260
|
+
|-----------|-----------|
|
|
261
|
+
| Language | Python 3.12+ |
|
|
262
|
+
| CLI | Typer + Rich |
|
|
263
|
+
| Contract parsing | Pydantic v2 |
|
|
264
|
+
| Data validation | DuckDB |
|
|
265
|
+
| Reporting | Jinja2 |
|
|
266
|
+
| Data formats | CSV, Parquet, JSON (via DuckDB) |
|
|
267
|
+
|
|
268
|
+
## Development
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
git clone https://github.com/ludovicschmetz-stack/datavow.git
|
|
272
|
+
cd datavow
|
|
273
|
+
python -m venv .venv && source .venv/bin/activate
|
|
274
|
+
pip install -e '.[dev]'
|
|
275
|
+
pytest tests/ -v
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
## Roadmap
|
|
279
|
+
|
|
280
|
+
- [x] **Phase 1 — CLI MVP** (done)
|
|
281
|
+
- [ ] **Phase 2 — Integrations**: dbt post-hook, Airflow operator, GitHub Action, PostgreSQL/MySQL via DuckDB, Slack/Teams notifications
|
|
282
|
+
- [ ] **Phase 3 — SaaS**: web dashboard, contract catalogue, role-based access, API
|
|
283
|
+
|
|
284
|
+
## License
|
|
285
|
+
|
|
286
|
+
[Apache 2.0](LICENSE) — free and open source forever. The CLI stays free. Monetization comes from the SaaS (Phase 3).
|
|
287
|
+
|
|
288
|
+
## Author
|
|
289
|
+
|
|
290
|
+
Built by [Ludovic Schmetz](https://github.com/ludovicschmetz-stack) — Senior Data Engineer/Architect, Luxembourg. Also the author of [Olympus](https://github.com/ludovicschmetz-stack/olympus).
|