Registry / database / localdb-json

localdb-json

JSON →
library1.0pypypi✓ verified 80d ago

A helper script for easily handling JSON files as a local database. Provides a simple class to load, manipulate, and save data persisted in a JSON file. Intended for small-scale local storage needs. Version 1.0, no active development observed.

pip install localdb-json
INSTALL
IMPORT
SIG · LOCALDB-JSON
L
localdb-json
databasepythonv1.0
Install
1.6s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Database
from localdb import Database
from localdb_json import JSONDatabase
getsize
from localdb import getsize
from localdb_json import JSONDatabase

Basic usage: create a JSONDatabase instance, assign data, call save().

from localdb_json import JSONDatabase db = JSONDatabase('data.json') db['users'] = [{'name': 'Alice', 'age': 30}] db.save() print(db['users'])
Debug
Known issues
gotchaThe library uses a hyphen in the package name (localdb-json). When importing in Python, you must replace hyphens with underscores: `from localdb_json import JSONDatabase`. Attempting `import localdb-json` will raise a syntax error.
fix
Use underscore in import: from localdb_json import JSONDatabase
affects: >=1.0
gotchaJSONDatabase saves data back to the file only when .save() is called explicitly. Modifying the in-memory dict does not persist automatically.
fix
Always call db.save() after making changes to write to disk.
affects: >=1.0
gotchaThe library does not handle concurrent access. Writing from multiple processes or threads may cause corruption or data loss.
fix
Use only in single-threaded, single-process scenarios, or implement your own locking mechanism.
affects: >=1.0
Upgrade
Version history
1.0latest on PyPI · released Feb 6, 2022
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
Resources
localdb-json — pip install localdb-json · libregistry