Skip to main content

A Python-native object database

Project description

YourDB

YourDB is a lightweight, Python-native object database designed to persist and query Python objects with schema validation and SQL-like querying capabilities.

It allows developers to define entities using Python dictionaries (or class-like schemas), insert objects, and perform filtering, updating, or deleting — all using native Python.


🔍 Features

  • 🧱 Define custom entities with schema validation
  • 📦 Store any Python dictionary or object (pickle-backed)
  • 🧠 Functional querying with lambda conditions
  • 🛠 Update & delete data using custom logic
  • 💾 Persistent storage using pickle under the hood
  • 🔍 Future extensibility for SQL-like syntax and class-based schemas

📦 Installation

git clone https://github.com/Dhruv251004/yourdb
cd yourdb
pip install .

🏁 Quickstart

from yourdb.yourdb import YourDB

# Create or connect to a DB
db = YourDB("my_database")

# Define entity schema (like a table schema)
schema = {
    "id": int,
    "name": str,
    "is_active": bool
}
db.create_entity("users", schema)

# Insert data
user1 = {"id": 1, "name": "Alice", "is_active": True}
db.insert_into("users", user1)

# Query data
results = db.select_from("users", lambda u: u["is_active"])
print(results)

# Update data
db.update_entity("users", lambda u: u["name"] == "Alice", lambda u: {**u, "is_active": False})

# Delete data
db.delete_from("users", lambda u: u["id"] == 1)

📁 Directory Structure

yourdb/
│
├── yourdb/ # Core module
│ ├── **init**.py
│ ├── yourdb.py # Main DB interface
│ ├── entity.py # Entity-level logic
│ ├── utils.py # Schema validation
│ └── test.py # Basic tests
│
├── LICENSE
├── MANIFEST.in
├── Readme.md
└── requirements.txt

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

yourdb-0.1.0.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

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

yourdb-0.1.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file yourdb-0.1.0.tar.gz.

File metadata

  • Download URL: yourdb-0.1.0.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for yourdb-0.1.0.tar.gz
Algorithm Hash digest
SHA256 37817a5f0080a8c3a43dca68ad4d1b1f5c13f68f9a15c80eafa318d246efd9f0
MD5 b1dc7d74fa121eadd60522c224ae4387
BLAKE2b-256 6da47068293110746d07df3b42f7e6f19428489def6bf09db76b353afbc8dec5

See more details on using hashes here.

File details

Details for the file yourdb-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: yourdb-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.4

File hashes

Hashes for yourdb-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 85eded0245f591f24f591af7a7ef8b0ea160d54cd8bf3eb452eb433cdab5c358
MD5 cdcabf156215cd98b713d1be9d34d8f3
BLAKE2b-256 c987ed8f057be6c98d98f3f5cb655bb5ddf9789761977c980298d27aad926836

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