Metadata-Version: 2.1
Name: ducttapedb
Version: 2024.12.5.1
Summary: Lightweight NoSQL-like database with SQLite.
Author-email: Gabu <gaburyuu@gmail.com>
Maintainer-email: Gabu <gaburyuu@gmail.com>
License: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pydantic>=2.0.0

# 🛠️ DuctTapeDB

DuctTapeDB is a lightweight, SQLite-powered, NoSQL-like database. It’s like a duct-tape fix for when you need simple JSON storage without the complexity of a full-blown database. Built with Python, it integrates neatly with Pydantic models for schema validation and object management.

Originally used for a hobby project of mine. Perfect for hobby projects or just experimenting with a "NoSQL but make it SQLite" approach. 🚀

---

## **Features**

- **JSON Storage**: Store and query JSON documents like you would in a NoSQL database.
- **Pydantic Integration**: Use Pydantic models to validate and manage your data, and auto-save the models to the database.
- **Lightweight**: Powered by SQLite—no server needed, works out-of-the-box!

---

### **TODO**

- **Relationships**: Simulate document relationships across tables.

---

## **Installation**

You can install DuctTapeDB using pip:

```bash
pip install ducttapedb
```

## Quickstart

### Here's how you can get started:

1. Create a Database

```python
from ducttapedb.ducttapedb import DuctTapeDB

# Create an in-memory database
db = DuctTapeDB.create_memory()
```

2. Define a Pydantic Model

```python
from ducttapedb.ducttapemodel import DuctTapeModel

class MyDocument(DuctTapeModel):
    name: str
    value: int
```

3. Save and Retrieve Data

```python
# Create an instance
doc = MyDocument(name="Slime", value=42)

# Save to the database
doc.save(db)

# Retrieve by ID
retrieved_doc = MyDocument.from_id(db, doc.id)
print(retrieved_doc)
```
