A lightweight in-memory database for Python — perfect for testing and prototyping.
Project description
DummyDB
DummyDB is a lightweight, in-memory Python database for testing, prototyping, and mocking database operations without installing any external database servers.
It mimics the basic behavior of real databases like MongoDB or SQLite but runs entirely in memory. Ideal for developers who want fast CRUD operations without setup overhead.
Features
- In-memory storage (no installation required)
- Table creation and management
- CRUD operations: insert, find, update, delete
- Save and load database to JSON
- Lightweight and zero-dependency
- Perfect for unit testing, demos, and small projects
Installation
pip install dummydb
Functions
> insert(data: dict)
> find(query: dict)
> update(query: dict, new_data: dict)
> delete(query: dict)
> to_json()
> create_table(name: str)
> get_table(name: str)
> drop_table(name: str)
> save_to_file(filepath: str)
> load_from_file(filepath: str)
Example Usage
from dummydb import Database
# Create a database
db = Database()
# Create a table
users = db.create_table("users")
# Insert records
users.insert({"name": "Vibhakar", "age": 17})
users.insert({"name": "Shiju", "age": 16})
# Query records
print(users.find({"age": 17}))
# Update records
users.update({"name": "Shiju"}, {"age": 17})
# Delete records
users.delete({"name": "Vibhakar"})
# Save/load
db.save_to_file("dummydb.json")
db.load_from_file("dummydb.json")
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
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 dummydb-0.1.6.tar.gz.
File metadata
- Download URL: dummydb-0.1.6.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24f2a6c7b1ddcc23ac0494aa0ef1167027455574b2519a09547468f23a6238fd
|
|
| MD5 |
15ba12ef1b9b669f73c246ed9bfa4744
|
|
| BLAKE2b-256 |
5bc021f7f680ad06d9c8a55e34c176b482e83fa97b67c9507676c0651d3a7c6f
|
File details
Details for the file dummydb-0.1.6-py3-none-any.whl.
File metadata
- Download URL: dummydb-0.1.6-py3-none-any.whl
- Upload date:
- Size: 5.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f1e1091266ec2c9da6e94bc67b70c9a4324ec469df76b4289049217ff74e1b4
|
|
| MD5 |
2f49268bc9fe56365f40ee87db4fa7ce
|
|
| BLAKE2b-256 |
7a28f2d78f873e0442882c3d01ce6d2fc9c5a41472bdbe3f92ee406365fabeb4
|