Metadata-Version: 2.4
Name: af_json_teach
Version: 0.1.0
Summary: A versioned JSON export utility with hash tracking
Home-page: https://github.com/abbasfaramarzi/af_json_teach
Author: Abbas Faramarzi
Author-email: Abbas Faramarzi <abbasfaramarzi@068gmail.com>
License: MIT License
Project-URL: Homepage, https://github.com/abbasfaamarzi/af_json_teach
Project-URL: Bug Reports, https://github.com/abbasfaamarzi/af_json_teach/issues
Project-URL: Source, https://github.com/abbasfaamarzi/af_json_teach
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

```markdown
# 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

```python
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](https://github.com/abbasfaamarzi)
```
