Skip to main content

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.

PyPI version License

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

dummydb-0.1.5.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

dummydb-0.1.5-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file dummydb-0.1.5.tar.gz.

File metadata

  • Download URL: dummydb-0.1.5.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for dummydb-0.1.5.tar.gz
Algorithm Hash digest
SHA256 ab01361fd63db579f4bcba7652b950f782ec4270f0a21815537fb0932902acc1
MD5 5e46ba5ad6f7c32a212d1782fcfb9830
BLAKE2b-256 790e06e8cde1c4e0bca8e074840e2f325f974a0de08d66c24ef50dab86fd10fd

See more details on using hashes here.

File details

Details for the file dummydb-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: dummydb-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for dummydb-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7cc1beae112c7e5fe4aa8270cef61cd876b670952a2c70efca42647f1aad548e
MD5 edf4c8b67fac0eef38f01d990bfb70ba
BLAKE2b-256 61f11b62e81001660c75920fbd0ae96d06e9f7f76df81502efe142f207ce3b70

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