Detect schema drift in JSON APIs
Project description
Schema Drift Detector - CLI
Schema Drift Detector is a CLI that:
- Fetches a JSON payload from an HTTP API endpoint (GET for v1).
- Loads a “baseline” schema from a local file (JSON).
- Compares structure: added/removed/changed fields, type changes, optional vs required.
- Outputs the diff in three formats: JSON, Markdown, and a pretty terminal table.
Language & Stack
I used Python and Click for the CLI as they make argument parsing, subcommands, and help text clean and maintainable.
Output Examples
JSON:
Simple:
print(json.dumps(diff, indent=2))
Good for machines and CI logs.
Markdown:
### Added fields
| Path | Type |
|-------------------|--------|
| `user.middle_name`| string |
Pretty Terminal Table:
ADDED | user.middle_name | - | string
Installation
Use the package manager pip to install reorder-editable.
pip install -e .
Usage
python -m schema_drift_cli --help
Commands
version- Shows the CLI version
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
Project details
Release history Release notifications | RSS feed
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 schema_drift_cli-0.1.0.tar.gz.
File metadata
- Download URL: schema_drift_cli-0.1.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd38394496150b9e911ebffcd4aff487c48073292d4d506cdd9b54292ce00f9b
|
|
| MD5 |
a21e976cc69c1621a6d060919850e9c5
|
|
| BLAKE2b-256 |
e579359dc4d821011c49fa3cf38b5a2ab8e15b9c8d5a83bf0cb69ab5e55fdf94
|
File details
Details for the file schema_drift_cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: schema_drift_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ccbaaabcf3a7434baf868d50b93ff5bc23b0c68e3f411346b300f57cf15afe1
|
|
| MD5 |
85d933f8d5994be68cb03b36022bd0d2
|
|
| BLAKE2b-256 |
3d337e85ab560f39f38174e1b2bd9a33cc8b8624b59119871f69399c57beadf2
|