Catalog PyPI
PACKAGE EXPLORERView in registry

af-json-teach

PyPI

A versioned JSON export utility with hash tracking

Versions collected1
Direct dependencies0From release 0.1.0
Last observed20 Oct, 21:07 UTC

README

Version 0.1.0 documentation
# 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 hash
  • load(version: int = None) -> dict – loads the latest or a specific version
  • list_versions() -> List[dict] – returns list of versions with metadata
  • diff(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

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.010 Jun 20260

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
abbasfaamarzi/af_json_teach

Shared repository data · GitHub

License detected in repository
Not collected

Repository

PENDING
abbasfaramarzi/af_json_teach

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 21:07 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:ea4a008b1f42596b28d17ce3da0b8ec4a6aa693fba0647f8421a448329a17f6c