9gear-sentinel 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.
Files changed (71) hide show
  1. 9gear_sentinel-0.1.0/.github/workflows/ci.yml +44 -0
  2. 9gear_sentinel-0.1.0/.github/workflows/docs.yml +40 -0
  3. 9gear_sentinel-0.1.0/.github/workflows/release.yml +65 -0
  4. 9gear_sentinel-0.1.0/.gitignore +14 -0
  5. 9gear_sentinel-0.1.0/CHANGELOG.md +28 -0
  6. 9gear_sentinel-0.1.0/CONTRIBUTING.md +31 -0
  7. 9gear_sentinel-0.1.0/LICENSE +201 -0
  8. 9gear_sentinel-0.1.0/PKG-INFO +134 -0
  9. 9gear_sentinel-0.1.0/README.md +90 -0
  10. 9gear_sentinel-0.1.0/docker-compose.yml +23 -0
  11. 9gear_sentinel-0.1.0/docs/alerts.md +60 -0
  12. 9gear_sentinel-0.1.0/docs/checks.md +103 -0
  13. 9gear_sentinel-0.1.0/docs/cli.md +54 -0
  14. 9gear_sentinel-0.1.0/docs/configuration.md +92 -0
  15. 9gear_sentinel-0.1.0/docs/getting-started.md +83 -0
  16. 9gear_sentinel-0.1.0/docs/index.md +30 -0
  17. 9gear_sentinel-0.1.0/docs/scheduling.md +72 -0
  18. 9gear_sentinel-0.1.0/examples/seed.sql +44 -0
  19. 9gear_sentinel-0.1.0/examples/sentinel.yml +54 -0
  20. 9gear_sentinel-0.1.0/mkdocs.yml +48 -0
  21. 9gear_sentinel-0.1.0/pyproject.toml +81 -0
  22. 9gear_sentinel-0.1.0/src/sentinel/__init__.py +3 -0
  23. 9gear_sentinel-0.1.0/src/sentinel/alerts/__init__.py +4 -0
  24. 9gear_sentinel-0.1.0/src/sentinel/alerts/dispatch.py +52 -0
  25. 9gear_sentinel-0.1.0/src/sentinel/alerts/emailer.py +35 -0
  26. 9gear_sentinel-0.1.0/src/sentinel/alerts/errors.py +2 -0
  27. 9gear_sentinel-0.1.0/src/sentinel/alerts/events.py +67 -0
  28. 9gear_sentinel-0.1.0/src/sentinel/alerts/slack.py +25 -0
  29. 9gear_sentinel-0.1.0/src/sentinel/checks/__init__.py +0 -0
  30. 9gear_sentinel-0.1.0/src/sentinel/checks/accepted_values.py +38 -0
  31. 9gear_sentinel-0.1.0/src/sentinel/checks/base.py +60 -0
  32. 9gear_sentinel-0.1.0/src/sentinel/checks/custom_sql.py +29 -0
  33. 9gear_sentinel-0.1.0/src/sentinel/checks/freshness.py +44 -0
  34. 9gear_sentinel-0.1.0/src/sentinel/checks/nulls.py +48 -0
  35. 9gear_sentinel-0.1.0/src/sentinel/checks/registry.py +21 -0
  36. 9gear_sentinel-0.1.0/src/sentinel/checks/row_count.py +57 -0
  37. 9gear_sentinel-0.1.0/src/sentinel/checks/schema_drift.py +60 -0
  38. 9gear_sentinel-0.1.0/src/sentinel/checks/unique.py +39 -0
  39. 9gear_sentinel-0.1.0/src/sentinel/cli.py +546 -0
  40. 9gear_sentinel-0.1.0/src/sentinel/config/__init__.py +4 -0
  41. 9gear_sentinel-0.1.0/src/sentinel/config/loader.py +232 -0
  42. 9gear_sentinel-0.1.0/src/sentinel/config/models.py +220 -0
  43. 9gear_sentinel-0.1.0/src/sentinel/connectors/__init__.py +15 -0
  44. 9gear_sentinel-0.1.0/src/sentinel/connectors/base.py +61 -0
  45. 9gear_sentinel-0.1.0/src/sentinel/report/__init__.py +3 -0
  46. 9gear_sentinel-0.1.0/src/sentinel/report/html.py +123 -0
  47. 9gear_sentinel-0.1.0/src/sentinel/runner.py +353 -0
  48. 9gear_sentinel-0.1.0/src/sentinel/scheduler.py +148 -0
  49. 9gear_sentinel-0.1.0/src/sentinel/store/__init__.py +3 -0
  50. 9gear_sentinel-0.1.0/src/sentinel/store/repository.py +280 -0
  51. 9gear_sentinel-0.1.0/src/sentinel/store/tables.py +47 -0
  52. 9gear_sentinel-0.1.0/src/sentinel/templates/env.example +3 -0
  53. 9gear_sentinel-0.1.0/src/sentinel/templates/sentinel.yml +25 -0
  54. 9gear_sentinel-0.1.0/src/sentinel/utils/__init__.py +0 -0
  55. 9gear_sentinel-0.1.0/src/sentinel/utils/durations.py +71 -0
  56. 9gear_sentinel-0.1.0/tests/__init__.py +0 -0
  57. 9gear_sentinel-0.1.0/tests/conftest.py +60 -0
  58. 9gear_sentinel-0.1.0/tests/integration/__init__.py +0 -0
  59. 9gear_sentinel-0.1.0/tests/integration/test_postgres.py +136 -0
  60. 9gear_sentinel-0.1.0/tests/unit/__init__.py +0 -0
  61. 9gear_sentinel-0.1.0/tests/unit/test_alerts.py +240 -0
  62. 9gear_sentinel-0.1.0/tests/unit/test_checks.py +194 -0
  63. 9gear_sentinel-0.1.0/tests/unit/test_cli.py +40 -0
  64. 9gear_sentinel-0.1.0/tests/unit/test_cli_run.py +111 -0
  65. 9gear_sentinel-0.1.0/tests/unit/test_config.py +120 -0
  66. 9gear_sentinel-0.1.0/tests/unit/test_durations.py +34 -0
  67. 9gear_sentinel-0.1.0/tests/unit/test_report.py +132 -0
  68. 9gear_sentinel-0.1.0/tests/unit/test_runner.py +153 -0
  69. 9gear_sentinel-0.1.0/tests/unit/test_scheduler.py +68 -0
  70. 9gear_sentinel-0.1.0/tests/unit/test_schema_drift.py +142 -0
  71. 9gear_sentinel-0.1.0/tests/unit/test_store.py +87 -0
@@ -0,0 +1,44 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ubuntu-latest
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ python-version: ["3.11", "3.12", "3.13", "3.14"]
15
+ services:
16
+ postgres:
17
+ image: postgres:16
18
+ env:
19
+ POSTGRES_USER: sentinel
20
+ POSTGRES_PASSWORD: sentinel
21
+ POSTGRES_DB: analytics
22
+ ports:
23
+ - 5432:5432
24
+ options: >-
25
+ --health-cmd "pg_isready -U sentinel -d analytics"
26
+ --health-interval 5s
27
+ --health-timeout 3s
28
+ --health-retries 10
29
+ env:
30
+ SENTINEL_TEST_PG_URL: postgresql+psycopg://sentinel:sentinel@localhost:5432/analytics
31
+ steps:
32
+ - uses: actions/checkout@v4
33
+ - uses: astral-sh/setup-uv@v5
34
+ - uses: actions/setup-python@v5
35
+ with:
36
+ python-version: ${{ matrix.python-version }}
37
+ - name: Install
38
+ run: uv pip install --system -e ".[dev]"
39
+ - name: Lint
40
+ run: ruff check . && ruff format --check .
41
+ - name: Type-check
42
+ run: mypy src
43
+ - name: Test
44
+ run: pytest --cov=sentinel --cov-report=term-missing
@@ -0,0 +1,40 @@
1
+ name: Docs
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ paths: ["docs/**", "mkdocs.yml", ".github/workflows/docs.yml"]
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+ pages: write
12
+ id-token: write
13
+
14
+ concurrency:
15
+ group: pages
16
+ cancel-in-progress: true
17
+
18
+ jobs:
19
+ build:
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+ - uses: actions/setup-python@v5
24
+ with:
25
+ python-version: "3.12"
26
+ - run: pip install "mkdocs-material>=9.5"
27
+ - run: mkdocs build --strict
28
+ - uses: actions/upload-pages-artifact@v3
29
+ with:
30
+ path: site
31
+
32
+ deploy:
33
+ needs: build
34
+ runs-on: ubuntu-latest
35
+ environment:
36
+ name: github-pages
37
+ url: ${{ steps.deployment.outputs.page_url }}
38
+ steps:
39
+ - id: deployment
40
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,65 @@
1
+ name: Release
2
+
3
+ # Push a tag like v0.1.0 to build, publish to PyPI and create a GitHub release.
4
+ on:
5
+ push:
6
+ tags: ["v*"]
7
+
8
+ jobs:
9
+ build:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: astral-sh/setup-uv@v5
14
+ - name: Check the tag matches the package version
15
+ run: |
16
+ VERSION=$(sed -n 's/^__version__ = "\(.*\)"/\1/p' src/sentinel/__init__.py)
17
+ if [ "v$VERSION" != "$GITHUB_REF_NAME" ]; then
18
+ echo "Tag $GITHUB_REF_NAME does not match __version__ $VERSION"
19
+ exit 1
20
+ fi
21
+ - name: Build
22
+ run: uv build
23
+ - name: Smoke-test the wheel
24
+ run: |
25
+ uv venv /tmp/smoke
26
+ uv pip install --python /tmp/smoke dist/*.whl
27
+ /tmp/smoke/bin/sentinel --version
28
+ - uses: actions/upload-artifact@v4
29
+ with:
30
+ name: dist
31
+ path: dist/
32
+
33
+ publish:
34
+ needs: build
35
+ runs-on: ubuntu-latest
36
+ environment:
37
+ name: pypi
38
+ url: https://pypi.org/p/9gear-sentinel
39
+ permissions:
40
+ id-token: write # trusted publishing: no API token stored anywhere
41
+ steps:
42
+ - uses: actions/download-artifact@v4
43
+ with:
44
+ name: dist
45
+ path: dist/
46
+ - uses: pypa/gh-action-pypi-publish@release/v1
47
+
48
+ github-release:
49
+ needs: publish
50
+ runs-on: ubuntu-latest
51
+ permissions:
52
+ contents: write
53
+ steps:
54
+ - uses: actions/download-artifact@v4
55
+ with:
56
+ name: dist
57
+ path: dist/
58
+ - name: Create GitHub release
59
+ env:
60
+ GH_TOKEN: ${{ github.token }}
61
+ run: >
62
+ gh release create "$GITHUB_REF_NAME" dist/*
63
+ --repo "$GITHUB_REPOSITORY"
64
+ --title "9Gear Sentinel $GITHUB_REF_NAME"
65
+ --generate-notes
@@ -0,0 +1,14 @@
1
+ __pycache__/
2
+ *.py[cod]
3
+ .venv/
4
+ .env
5
+ .sentinel/
6
+ dist/
7
+ build/
8
+ *.egg-info/
9
+ .pytest_cache/
10
+ .mypy_cache/
11
+ .ruff_cache/
12
+ .coverage
13
+ htmlcov/
14
+ sentinel-report.html
@@ -0,0 +1,28 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/), and versions follow [Semantic Versioning](https://semver.org/).
4
+
5
+ ## [0.1.0] - 2026-10-30
6
+
7
+ First public release.
8
+
9
+ ### Checks
10
+ - `freshness`, `row_count`, `row_count_change`, `not_null`, `null_rate`, `unique`, `accepted_values`, `schema_drift` and `custom_sql`
11
+ - Common options on every check: `severity`, `where`, `tags` and `name`
12
+
13
+ ### Commands
14
+ - `init`, `validate`, `test-connection`, `run`, `history`, `report`, `snapshot-schema`, `test-alert` and `watch`
15
+ - `run` filters (`--source`, `--table`, `--check`, `--tag`), `--dry-run`, `--no-store` and `--no-alerts`
16
+ - Exit codes: 0 passed or warned, 1 failed, 2 couldn't run
17
+
18
+ ### Configuration
19
+ - One YAML file with `${VAR}` and `${VAR:-default}` substitution and `.env` support
20
+ - Validation errors that name the file, line and field
21
+
22
+ ### Results and alerts
23
+ - Results store in SQLite or Postgres, with stable check keys so thresholds can change without losing history
24
+ - Slack and email alerts that fire on change of state: once on failure, once on recovery
25
+ - Self-contained HTML report with each check's recent trend
26
+
27
+ ### Databases
28
+ - Postgres and SQLite supported and tested
@@ -0,0 +1,31 @@
1
+ # Contributing
2
+
3
+ Thanks for helping improve 9Gear Sentinel.
4
+
5
+ ## Setup
6
+
7
+ ```bash
8
+ git clone https://github.com/Mirrz64/9Gear-Sentinel.git
9
+ cd 9Gear-Sentinel
10
+ uv venv && source .venv/bin/activate # Windows Git Bash: .venv/Scripts/activate
11
+ uv pip install -e ".[dev]"
12
+ ```
13
+
14
+ ## Before opening a pull request
15
+
16
+ ```bash
17
+ ruff format . && ruff check . && mypy src && pytest
18
+ ```
19
+
20
+ Postgres integration tests run when a database is available:
21
+
22
+ ```bash
23
+ docker compose up -d
24
+ SENTINEL_TEST_PG_URL=postgresql+psycopg://sentinel:sentinel@localhost:5433/analytics pytest
25
+ ```
26
+
27
+ ## Conventions
28
+
29
+ - Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/): `feat:`, `fix:`, `docs:`, `test:`, `chore:`.
30
+ - New check types live in `src/sentinel/checks/`, one file each, registered in `registry.py`, with unit tests that don't need a database.
31
+ - Keep user-facing messages short and specific: what was measured and what the limit was.
@@ -0,0 +1,201 @@
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 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 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 those 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
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,134 @@
1
+ Metadata-Version: 2.5
2
+ Name: 9gear-sentinel
3
+ Version: 0.1.0
4
+ Summary: Data quality checks for your warehouse, declared in YAML, run anywhere.
5
+ Project-URL: Homepage, https://github.com/Mirrz64/9Gear-Sentinel
6
+ Project-URL: Documentation, https://mirrz64.github.io/9Gear-Sentinel/
7
+ Project-URL: Repository, https://github.com/Mirrz64/9Gear-Sentinel
8
+ Project-URL: Issues, https://github.com/Mirrz64/9Gear-Sentinel/issues
9
+ Project-URL: Changelog, https://github.com/Mirrz64/9Gear-Sentinel/blob/main/CHANGELOG.md
10
+ Author: Miracle Osabuogbe
11
+ License: Apache-2.0
12
+ License-File: LICENSE
13
+ Keywords: data engineering,data observability,data quality,monitoring,sql
14
+ Classifier: Development Status :: 3 - Alpha
15
+ Classifier: Environment :: Console
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: License :: OSI Approved :: Apache Software License
18
+ Classifier: Operating System :: OS Independent
19
+ Classifier: Programming Language :: Python :: 3
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Programming Language :: Python :: 3.14
24
+ Classifier: Topic :: Database
25
+ Classifier: Topic :: Software Development :: Quality Assurance
26
+ Requires-Python: >=3.11
27
+ Requires-Dist: pydantic>=2.7
28
+ Requires-Dist: python-dotenv>=1.0
29
+ Requires-Dist: rich>=13.7
30
+ Requires-Dist: ruamel-yaml>=0.18
31
+ Requires-Dist: sqlalchemy>=2.0
32
+ Requires-Dist: typer>=0.12
33
+ Provides-Extra: dev
34
+ Requires-Dist: mypy>=1.10; extra == 'dev'
35
+ Requires-Dist: psycopg[binary]>=3.1; extra == 'dev'
36
+ Requires-Dist: pytest-cov>=5; extra == 'dev'
37
+ Requires-Dist: pytest>=8; extra == 'dev'
38
+ Requires-Dist: ruff>=0.6; extra == 'dev'
39
+ Provides-Extra: docs
40
+ Requires-Dist: mkdocs-material>=9.5; extra == 'docs'
41
+ Provides-Extra: postgres
42
+ Requires-Dist: psycopg[binary]>=3.1; extra == 'postgres'
43
+ Description-Content-Type: text/markdown
44
+
45
+ # 9Gear Sentinel
46
+
47
+ [![CI](https://github.com/Mirrz64/9Gear-Sentinel/actions/workflows/ci.yml/badge.svg)](https://github.com/Mirrz64/9Gear-Sentinel/actions/workflows/ci.yml)
48
+ [![PyPI](https://img.shields.io/pypi/v/9gear-sentinel)](https://pypi.org/project/9gear-sentinel/)
49
+ [![Python](https://img.shields.io/pypi/pyversions/9gear-sentinel)](https://pypi.org/project/9gear-sentinel/)
50
+ [![License](https://img.shields.io/badge/license-Apache--2.0-blue)](LICENSE)
51
+
52
+ **Data quality checks for your warehouse, declared in YAML and run anywhere you can run a command.**
53
+
54
+ Sentinel catches stale tables, sudden row-count drops, null spikes, duplicate keys and silent schema changes before your stakeholders do. Every check runs as SQL inside your own database, so your data never leaves it.
55
+
56
+ ![Sentinel running against a demo database](https://raw.githubusercontent.com/Mirrz64/9Gear-Sentinel/main/docs/assets/demo.gif)
57
+
58
+ ## Why Sentinel
59
+
60
+ - **Ten minutes to the first alert.** `pip install`, one YAML file, done. No server, no UI to host.
61
+ - **Alerts that don't nag.** Slack or email once when a check breaks and once when it recovers, not every hour while it stays broken.
62
+ - **It remembers.** Every run is stored, so checks can catch a 40% overnight drop in rows, and you can see each check's recent trend.
63
+ - **Fits your pipeline.** Clear exit codes for CI and Airflow, a built-in scheduler, and a shareable HTML report.
64
+ - **Plain SQL you can read.** `--dry-run` shows exactly what will be sent to your database.
65
+
66
+ ## Quickstart
67
+
68
+ ```bash
69
+ pip install "9gear-sentinel[postgres]"
70
+ sentinel init # writes sentinel.yml and .env.example
71
+ cp .env.example .env # set WAREHOUSE_URL
72
+ sentinel test-connection
73
+ sentinel run
74
+ ```
75
+
76
+ ```yaml
77
+ tables:
78
+ - source: warehouse
79
+ table: analytics.orders
80
+ checks:
81
+ - freshness: { column: updated_at, max_age: 6h }
82
+ - row_count_change: { max_drop_pct: 30 }
83
+ - unique: { columns: [order_id] }
84
+ - null_rate: { column: customer_id, max_pct: 1, severity: warn }
85
+ - accepted_values:
86
+ column: status
87
+ values: [pending, paid, shipped, refunded]
88
+ - schema_drift: {}
89
+ ```
90
+
91
+ Want to see it first? The repo includes a demo database with deliberate problems:
92
+
93
+ ```bash
94
+ git clone https://github.com/Mirrz64/9Gear-Sentinel.git && cd 9Gear-Sentinel
95
+ pip install -e ".[postgres]"
96
+ docker compose up -d
97
+ sentinel run -c examples/sentinel.yml
98
+ ```
99
+
100
+ ## Checks
101
+
102
+ | Check | Fails when |
103
+ | --- | --- |
104
+ | `freshness` | The newest timestamp is older than `max_age` |
105
+ | `row_count` | The row count is outside `min` / `max` |
106
+ | `row_count_change` | The count moved more than allowed since the last run |
107
+ | `not_null` | Any null appears in the column |
108
+ | `null_rate` | The share of nulls is above `max_pct` |
109
+ | `unique` | Any key value appears more than once |
110
+ | `accepted_values` | A value outside the list appears |
111
+ | `schema_drift` | A column is added, removed or retyped since the baseline |
112
+ | `custom_sql` | Your query returns any rows |
113
+
114
+ ## Reports
115
+
116
+ `sentinel report` turns the latest run into one self-contained HTML page, with failures first and each check's recent history.
117
+
118
+ ![HTML report](https://raw.githubusercontent.com/Mirrz64/9Gear-Sentinel/main/docs/assets/report.png)
119
+
120
+ ## Documentation
121
+
122
+ Full docs: **[mirrz64.github.io/9Gear-Sentinel](https://mirrz64.github.io/9Gear-Sentinel/)**, covering configuration, every check, alerts, scheduling, CI recipes and the CLI.
123
+
124
+ ## Supported databases
125
+
126
+ Postgres and SQLite are supported and tested. Snowflake and BigQuery are planned for v0.2.
127
+
128
+ ## Contributing
129
+
130
+ Issues and pull requests are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for setup.
131
+
132
+ ## Licence
133
+
134
+ [Apache-2.0](LICENSE). Built by Miracle Osabuogbe at 9Gear Tech.
@@ -0,0 +1,90 @@
1
+ # 9Gear Sentinel
2
+
3
+ [![CI](https://github.com/Mirrz64/9Gear-Sentinel/actions/workflows/ci.yml/badge.svg)](https://github.com/Mirrz64/9Gear-Sentinel/actions/workflows/ci.yml)
4
+ [![PyPI](https://img.shields.io/pypi/v/9gear-sentinel)](https://pypi.org/project/9gear-sentinel/)
5
+ [![Python](https://img.shields.io/pypi/pyversions/9gear-sentinel)](https://pypi.org/project/9gear-sentinel/)
6
+ [![License](https://img.shields.io/badge/license-Apache--2.0-blue)](LICENSE)
7
+
8
+ **Data quality checks for your warehouse, declared in YAML and run anywhere you can run a command.**
9
+
10
+ Sentinel catches stale tables, sudden row-count drops, null spikes, duplicate keys and silent schema changes before your stakeholders do. Every check runs as SQL inside your own database, so your data never leaves it.
11
+
12
+ ![Sentinel running against a demo database](https://raw.githubusercontent.com/Mirrz64/9Gear-Sentinel/main/docs/assets/demo.gif)
13
+
14
+ ## Why Sentinel
15
+
16
+ - **Ten minutes to the first alert.** `pip install`, one YAML file, done. No server, no UI to host.
17
+ - **Alerts that don't nag.** Slack or email once when a check breaks and once when it recovers, not every hour while it stays broken.
18
+ - **It remembers.** Every run is stored, so checks can catch a 40% overnight drop in rows, and you can see each check's recent trend.
19
+ - **Fits your pipeline.** Clear exit codes for CI and Airflow, a built-in scheduler, and a shareable HTML report.
20
+ - **Plain SQL you can read.** `--dry-run` shows exactly what will be sent to your database.
21
+
22
+ ## Quickstart
23
+
24
+ ```bash
25
+ pip install "9gear-sentinel[postgres]"
26
+ sentinel init # writes sentinel.yml and .env.example
27
+ cp .env.example .env # set WAREHOUSE_URL
28
+ sentinel test-connection
29
+ sentinel run
30
+ ```
31
+
32
+ ```yaml
33
+ tables:
34
+ - source: warehouse
35
+ table: analytics.orders
36
+ checks:
37
+ - freshness: { column: updated_at, max_age: 6h }
38
+ - row_count_change: { max_drop_pct: 30 }
39
+ - unique: { columns: [order_id] }
40
+ - null_rate: { column: customer_id, max_pct: 1, severity: warn }
41
+ - accepted_values:
42
+ column: status
43
+ values: [pending, paid, shipped, refunded]
44
+ - schema_drift: {}
45
+ ```
46
+
47
+ Want to see it first? The repo includes a demo database with deliberate problems:
48
+
49
+ ```bash
50
+ git clone https://github.com/Mirrz64/9Gear-Sentinel.git && cd 9Gear-Sentinel
51
+ pip install -e ".[postgres]"
52
+ docker compose up -d
53
+ sentinel run -c examples/sentinel.yml
54
+ ```
55
+
56
+ ## Checks
57
+
58
+ | Check | Fails when |
59
+ | --- | --- |
60
+ | `freshness` | The newest timestamp is older than `max_age` |
61
+ | `row_count` | The row count is outside `min` / `max` |
62
+ | `row_count_change` | The count moved more than allowed since the last run |
63
+ | `not_null` | Any null appears in the column |
64
+ | `null_rate` | The share of nulls is above `max_pct` |
65
+ | `unique` | Any key value appears more than once |
66
+ | `accepted_values` | A value outside the list appears |
67
+ | `schema_drift` | A column is added, removed or retyped since the baseline |
68
+ | `custom_sql` | Your query returns any rows |
69
+
70
+ ## Reports
71
+
72
+ `sentinel report` turns the latest run into one self-contained HTML page, with failures first and each check's recent history.
73
+
74
+ ![HTML report](https://raw.githubusercontent.com/Mirrz64/9Gear-Sentinel/main/docs/assets/report.png)
75
+
76
+ ## Documentation
77
+
78
+ Full docs: **[mirrz64.github.io/9Gear-Sentinel](https://mirrz64.github.io/9Gear-Sentinel/)**, covering configuration, every check, alerts, scheduling, CI recipes and the CLI.
79
+
80
+ ## Supported databases
81
+
82
+ Postgres and SQLite are supported and tested. Snowflake and BigQuery are planned for v0.2.
83
+
84
+ ## Contributing
85
+
86
+ Issues and pull requests are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for setup.
87
+
88
+ ## Licence
89
+
90
+ [Apache-2.0](LICENSE). Built by Miracle Osabuogbe at 9Gear Tech.
@@ -0,0 +1,23 @@
1
+ # Local Postgres with demo data for trying Sentinel and running integration tests.
2
+ # Start: docker compose up -d
3
+ # Reset: docker compose down -v && docker compose up -d
4
+ services:
5
+ postgres:
6
+ image: postgres:16
7
+ environment:
8
+ POSTGRES_USER: sentinel
9
+ POSTGRES_PASSWORD: sentinel
10
+ POSTGRES_DB: analytics
11
+ ports:
12
+ - "5433:5432"
13
+ volumes:
14
+ - ./examples/seed.sql:/docker-entrypoint-initdb.d/01-seed.sql:ro
15
+ - pgdata:/var/lib/postgresql/data
16
+ healthcheck:
17
+ test: ["CMD-SHELL", "pg_isready -U sentinel -d analytics"]
18
+ interval: 5s
19
+ timeout: 3s
20
+ retries: 10
21
+
22
+ volumes:
23
+ pgdata: