Skip to main content

A lightweight encrypted local database using dictionary-based storage

Project description

MineDB

MineDB is a lightweight, encrypted, dictionary-based local database written in Python. It is designed to be simple, schema-safe, and usable directly after installation without requiring any external database server.

PyPI: https://pypi.org/project/minedb/

MineDB is ideal for:

  • Small to medium projects
  • Local persistence
  • Configuration storage
  • Lightweight applications where SQLite or full databases are overkill

FEATURES

  • Encrypted local storage (Fernet encryption)
  • Pure Python, pip-installable
  • Schema-safe operations (no silent corruption)
  • Dictionary-based column-oriented storage
  • Safe schema evolution (add/drop/rename fields)
  • Fully tested with pytest
  • No external database required

INSTALLATION

pip install minedb

QUICK START

from MineDB import MineDB

db = MineDB()

db.createDB("testdb") db.createCollection( "testdb", "users", id="int", active="bool" )

db.load(id=1, active=True) db.load(id=2, active=False)

db.modify("id", 1, "active", False) db.remove("id", 2)

db.save()

HOW MINEDB WORKS

  • Data is stored as encrypted JSON on disk
  • Each collection uses column-oriented storage
  • All operations enforce schema consistency
  • Partial writes and index drift are prevented by design

MineDB guarantees that all fields in a collection always remain aligned.

SCHEMA OPERATIONS

Add field: db.alterAddField("testdb", "users", "score", "float")

Drop field: db.alterDropField("testdb", "users", "score")

Change field type (safe conversion): db.alterFieldType("testdb", "users", "active", "int")

ENCRYPTION

MineDB uses cryptography.Fernet for encryption.

  • Data is always stored encrypted on disk
  • Encryption key is generated on first run
  • Key is reused safely across sessions

Note: MineDB encryption is intended for local protection, not high-threat adversarial environments.

TESTING

Run tests using: pytest

REQUIREMENTS

Python 3.9 or higher cryptography

LICENSE

MIT License (see LICENSE.txt)

AUTHOR

Harsh Singh Sikarwar

DISCLAIMER

MineDB is intended for local and lightweight use cases. It is not a replacement for full-scale database systems.

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

minedb-1.0.1.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

minedb-1.0.1-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file minedb-1.0.1.tar.gz.

File metadata

  • Download URL: minedb-1.0.1.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for minedb-1.0.1.tar.gz
Algorithm Hash digest
SHA256 3815a672601b2bf5b02f3b3170aa7b3c21e2c5b8abd0ab43dc5184c6bfa1ce3e
MD5 e7ea212168ca82def75e82a8335c5511
BLAKE2b-256 a714bf5156c614705502e5be85ef7a702fcaf46ff5fceaf16856541f839ced80

See more details on using hashes here.

File details

Details for the file minedb-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: minedb-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for minedb-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 778d0264dd80953e11515c8668833c375dd1e89d0ef9aa72bd5185c52867732c
MD5 6b5ba4c52dea8613520146df7c95f873
BLAKE2b-256 2b89e51205c683d3fa3e44cef20b0f0af8f447a3d656aa4beacf3887c46c7b40

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