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.3.0.tar.gz (3.9 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.3.0-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for jawadb-0.3.0.tar.gz
Algorithm Hash digest
SHA256 18f953732fcf3ba5dea2b9957178012490e206dfea15765d337fe345d1df22f7
MD5 1bbf62ef745473bcf85c03c78b2c7495
BLAKE2b-256 34abdfbe2e7515541255e7ec5c794461494f3db5b2e0a30755c1a9205f99d7fa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jawadb-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 4.5 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 52afd04d2623c41c138d9305d6d16291b3dff3f26bb0bfe76f4898320471f3e3
MD5 6b65246c072cc1a1a1ea86e2970ae25b
BLAKE2b-256 f2eeecb0f510efc0daad79a2839af3384c1f34ac65a97d390b196e1df0741fd8

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