Lightweight local NoSQL, SQL, and Graph embedded database engine
Project description
☕ Coffy
Coffy is a lightweight embedded database engine for Python, designed for local-first apps, scripts, and tools. It includes:
coffy.nosql: A simple JSON-backed NoSQL engine with a fluent, chainable query interfacecoffy.sql: A wrapper over SQLite for executing raw SQL with clean tabular resultscoffy.graph: An graph engine built onnetworkxwith advanced filtering and logic-based querying
No dependencies (except networkx). No boilerplate. Just data.
🔧 Install
pip install coffy
📂 Modules
coffy.nosql
- JSON-based collections with fluent
.where().eq().gt()...query chaining - Joins, updates, filters, aggregation, export/import
- All data saved to human-readable
.jsonfiles
coffy.sql
- SQLite-backed engine with raw SQL query support
- Outputs as readable tables or exportable lists
- Uses in-memory DB by default, or json-based if initialized with a path
coffy.graph
- Wrapper around
networkxwith simplified node/relationship API - Query nodes and relationships using filters like
gt,lt,eq,or,not - Uses in-memory DB by default, or json-based if initialized with a path
🧪 Example
from coffy.nosql import db
users = db("users", path="users.json")
users.add({"id": 1, "name": "Neel"})
print(users.where("name").eq("Neel").first())
from coffy.sql import init, query
init("app.db")
query("CREATE TABLE test (id INT, name TEXT)")
query("INSERT INTO test VALUES (1, 'Neel')")
print(query("SELECT * FROM test"))
from coffy.graph import GraphDB
g = GraphDB(directed=True)
g.add_nodes([{"id": 1, "name": "Neel"}, {"id": 2, "name": "Tanaya"}])
g.add_relationships([{"source": 1, "target": 2, "type": "friend"}])
print(g.find_relationships(type="friend"))
📄 License
MIT © 2025 nsarathy
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
coffy-0.1.2.tar.gz
(34.6 kB
view details)
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
coffy-0.1.2-py3-none-any.whl
(43.5 kB
view details)
File details
Details for the file coffy-0.1.2.tar.gz.
File metadata
- Download URL: coffy-0.1.2.tar.gz
- Upload date:
- Size: 34.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29e0bc072df10abd37810f6e24ed9a1538d2f4ea7fbecb9865d539d854fb8326
|
|
| MD5 |
5285647a6fb9a7e7704fe0860bebbda5
|
|
| BLAKE2b-256 |
ad1b4e6b38987072d02632ba14f0c6a963c87877c343ecf1dbc0949aed7bd909
|
File details
Details for the file coffy-0.1.2-py3-none-any.whl.
File metadata
- Download URL: coffy-0.1.2-py3-none-any.whl
- Upload date:
- Size: 43.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e00188bb278e3d1643b9d3e28f3e6f94d21941515fbed501963f7c63b936aa2e
|
|
| MD5 |
d8b939fc58ae51f779bd8ad5b7061c1d
|
|
| BLAKE2b-256 |
fa48f6fe89818887cd3b54cef0266d13baaa7e4eb1dce637ab4b51a5e9ac3545
|