A lightweight file-based database for Python projects.
Project description
tinyfiledb
A lightweight file-based database for Python projects. No server, no migrations, no dependencies — just a local JSON file and a simple API.
Install
pip install tinyfiledb
Usage
from tinyfiledb import FileDB
db = FileDB("mydata.json")
# Insert a record
user_id = db.insert({"name": "Alice", "role": "admin"})
# Get, update, list, delete
print(db.get(user_id))
db.update(user_id, {"role": "superadmin"})
print(db.all())
db.delete(user_id)
API
insert(record)— add a record, get back an auto-generated IDget(id)— retrieve one record by ID (returnsNoneif not found)all()— return every record as a dictupdate(id, data)— merge data into an existing record; returnsTrueif founddelete(id)— remove a record; returnsTrueif found
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tinyfiledb-0.1.0.tar.gz
(1.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tinyfiledb-0.1.0.tar.gz.
File metadata
- Download URL: tinyfiledb-0.1.0.tar.gz
- Upload date:
- Size: 1.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a485815bec2199aa030ff9b5c2a6c68482b7eeb6b10b7b6db88df9e074be2b8e
|
|
| MD5 |
ff12348c06fcd0fe47da5572ecde63c5
|
|
| BLAKE2b-256 |
0228073aa8aad594512306fe87224f369d14071034ad40dd8369c934d71b94ea
|
File details
Details for the file tinyfiledb-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tinyfiledb-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98fab5fa3bec1b80c17616eecf6ebde30af7d90087e104ffb0e2b5c70012a13e
|
|
| MD5 |
d79cd05efa5fe9dec8cb1d771c618ff2
|
|
| BLAKE2b-256 |
5911729eedd72ae14768e0928d800a7909c6b463c97dce550a8d282cc08cb447
|