Skip to main content

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

tinyjsondb-0.1.1.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tinyjsondb-0.1.1-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file tinyjsondb-0.1.1.tar.gz.

File metadata

  • Download URL: tinyjsondb-0.1.1.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

Hashes for tinyjsondb-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f3b7fd3b16e4242994156fa6d8dafebaf981e1d82acf657f0dd2679f789303d2
MD5 d2e45cfb5bd63e3252d6981c216619ee
BLAKE2b-256 cb94f20b9e5c6f4ca04753d644820e79bf7d41eff47a5d43c724b399de816a19

See more details on using hashes here.

File details

Details for the file tinyjsondb-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tinyjsondb-0.1.1-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

Hashes for tinyjsondb-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c93643bbd8304b24b8947912b24e975ef4d854c3e94d921f0c675d98d0926b21
MD5 2321999ce79d3ac849ac3b5bb67cc4ae
BLAKE2b-256 c9d47fa2f653902785f260cac6235dcf32cd3d291210117c3ad2482df6ec343b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page