# af_json_teach
A lightweight Python utility for exporting JSON data with automatic versioning and hash tracking.
Ideal for saving snapshots, comparing changes, and ensuring data integrity.
## Features
- Save JSON data with an auto-generated hash (SHA256)
- Track version history of JSON documents
- Load and compare different versions
- Simple API for teaching and small projects
## Installation
```bash
pip install af_json_teach
Quick Start
from af_json_teach import JSONVersioner
# Create a versioner instance (uses a local sqlite database)
jv = JSONVersioner("my_data.json")
# Save a JSON object – automatically stores hash and timestamp
jv.save({"name": "Alice", "score": 100})
# Load the latest version
data = jv.load()
print(data)
# List all versions with timestamps
versions = jv.list_versions()
print(versions)
# Compare two versions
diff = jv.diff(version1=1, version2=2)
API Reference
JSONVersioner(file_path: str, db_path: str = "versions.db")
save(data: dict) -> str– saves data, returns the hashload(version: int = None) -> dict– loads the latest or a specific versionlist_versions() -> List[dict]– returns list of versions with metadatadiff(version1: int, version2: int) -> dict– shows differences between two versions
Requirements
- Python >= 3.6
- No external dependencies (uses standard library only)
License
MIT License
Author
Abbas Faramarzi – GitHub
Metadata
Release files for af-json-teach 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| af_json_teach-0.1.0.tar.gz | 3.6 kB | Without provenance | Details for af_json_teach-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| af_json_teach-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for af_json_teach-0.1.0-py3-none-any.whl |
Total release size: 7.5 kB
Release files / af_json_teach-0.1.0.tar.gz
| Download URL | af_json_teach-0.1.0.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e83be7554931b4beb7b0d07ffe724d14630dbf13e95d9b4165957cc6fd560202
|
|
BLAKE2b-256 checksum How to use checksums |
522a39be96f83a98a18e94557ab7569472d7255a2fd601a560165107b6a02a0e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.9
|
Release files / af_json_teach-0.1.0-py3-none-any.whl
| Download URL | af_json_teach-0.1.0-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b59b0582a01ddea313194a637f890f8f1bb8c835d06ab3884780c7931adc1ef6
|
|
BLAKE2b-256 checksum How to use checksums |
a1623202888eb74ede067687c3d570b37e7fbb6d291380f982426a0b47c81ba8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.9
|
Security for af-json-teach 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.