Skip to main content

A simple persistent JSON database for Python

Project description

JawaDB

A simple persistent JSON database for Python that acts like a regular dictionary or list.

Installation

pip install jawadb

Usage

import jawadb

# Use as dictionary
db = jawadb.load("mydata.json")
db["key"] = "value"
db["nested"] = {"foo": "bar"}
# File is automatically saved when db is garbage collected

# Use as list
db = jawadb.load("mylist.json")
db += ["item1", "item2"]
db.append("item3")
# File is automatically saved

Features

  • Automatic persistence to JSON file
  • Use as either dictionary or list (type is determined by first operation)
  • Handles nested structures
  • Atomic file writes
  • Saves on program exit, Ctrl-C, and garbage collection
  • Type hints included

License

MIT License

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

jawadb-0.2.2.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

jawadb-0.2.2-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file jawadb-0.2.2.tar.gz.

File metadata

  • Download URL: jawadb-0.2.2.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for jawadb-0.2.2.tar.gz
Algorithm Hash digest
SHA256 025142053b9c545ef8a7926c5f71687630c51bb151f488b6cfdbcdc306bd277a
MD5 af85206236a8e1a9e3ec47cb638d5840
BLAKE2b-256 7ed5eefb351c8f68739dc3550abdbd49b5b81cf5225e354aba03e2d2b67f7334

See more details on using hashes here.

File details

Details for the file jawadb-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: jawadb-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for jawadb-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0aa60b2ea4cfee2dcab9e2986b1c340ed16f8f567cf93d4096e71a23a1ec6c35
MD5 78b4313a02183dc1069350d2b99524f1
BLAKE2b-256 f75f602b011b327c11467254a350d5b4c7c17d617206c3eb21d04155e1cbf499

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