Skip to main content

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 ID
  • get(id) — retrieve one record by ID (returns None if not found)
  • all() — return every record as a dict
  • update(id, data) — merge data into an existing record; returns True if found
  • delete(id) — remove a record; returns True if found

License

MIT

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

tinyfiledb-0.1.0.tar.gz (1.7 kB view details)

Uploaded Source

Built Distribution

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

tinyfiledb-0.1.0-py3-none-any.whl (2.0 kB view details)

Uploaded Python 3

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

Hashes for tinyfiledb-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a485815bec2199aa030ff9b5c2a6c68482b7eeb6b10b7b6db88df9e074be2b8e
MD5 ff12348c06fcd0fe47da5572ecde63c5
BLAKE2b-256 0228073aa8aad594512306fe87224f369d14071034ad40dd8369c934d71b94ea

See more details on using hashes here.

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

Hashes for tinyfiledb-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 98fab5fa3bec1b80c17616eecf6ebde30af7d90087e104ffb0e2b5c70012a13e
MD5 d79cd05efa5fe9dec8cb1d771c618ff2
BLAKE2b-256 5911729eedd72ae14768e0928d800a7909c6b463c97dce550a8d282cc08cb447

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