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.1.0.tar.gz (3.7 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.1.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for jawadb-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ee386e15c32353c43f1aeda3663003a32289e859449e02f6df6109ce09b03442
MD5 2f5908a86c57b67f55da0d9f34f549f4
BLAKE2b-256 3d57d66be8fde06ad8c7a2ede30d9db6ab3c061068c80b4e7acf528572766be4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: jawadb-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.3 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7b00072853b7ce461d600ba5f509541627604baedeb13312176eaed6ed7ebda
MD5 9ba29af8f10a0e1dfcfdc6b143a74ed5
BLAKE2b-256 c5ddea45d874f80dd413cef3f23bf10b859017f5709df38d216850f5fed0fc04

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