Embedded JSON-based ORM-like database for small Python projects
Project description
tinyjsondb
tinyjsondb is a tiny, JSON-backed, embedded database with an ORM-like API.
It stores each model in a single .json file and provides CRUD operations through familiar Django-style managers.
Requirements
- Python ≥ 3.8
- portalocker (for cross-platform file locking)
Installation
install latest commit from GitHub
pip install git+https://github.com/Waland2/tinyjsondb.git
Quick start
from tinyjsondb import Model, IntegerField, StringField
class User(Model):
path_to_file = "users.json" # store data in users.json
age = IntegerField()
name = StringField(default="Anonymous")
User.sync() # create or migrate the file
# create
alice = User.objects.create(age=24, name="Alice")
# read
bob = User.objects.get(age=24)
# update
bob.update(name="Bob")
# delete
bob.delete()
License MIT © 2025 Waland2
Project details
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 tinyjsondb-0.1.0.tar.gz.
File metadata
- Download URL: tinyjsondb-0.1.0.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df231ef635f5743399aba1c2046db15a1a9a14dcca2540bfb0cc142fe9e27298
|
|
| MD5 |
4c96d0a3675cd7d422cabf7003a96055
|
|
| BLAKE2b-256 |
b9e7f3a63435095a7f98d6fd25e66f0ca0f30939462dea2f8ae38a28ec787c5c
|
File details
Details for the file tinyjsondb-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tinyjsondb-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e2135d0ba872494fa6bce1ee89cba671741f9a526c6d74149f29a827d93082f
|
|
| MD5 |
e5def06677e17edc9b83b151d716a325
|
|
| BLAKE2b-256 |
d75163e09ac4b6462599f105fef22dddcc1163ca5f4160526744cf1eaa7c7b03
|