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.graph: An graph engine built onnetworkxwith advanced filtering and logic-based queryingcoffy.sql: A wrapper overSQLitefor executing raw SQL
Latest Updates
- Added projection and dot-notation support for nested fields in NoSQL queries. Expanded logic chaining (
_and,_or,_not) with improved test and better query semantics. - GraphDB now supports saving query results, fixed relationship type serialization, and added more robust unit coverage.
- Unit tests added to test NoSQL and Graph database features.
- Documentation Updated.
🔧 Install
pip install coffy
📂 Modules
coffy.nosql
- Embedded NoSQL document store with a fluent, chainable query API
- Supports nested fields, logical filters, aggregations, projections, and joins
- Built for local usage with optional persistence; minimal setup, fast iteration
coffy.graph
- Lightweight, file-backed graph database using
networkxunder the hood - Supports pattern matching, label/type filtering, logical conditions, and projections
- Query results can be saved, updated, or transformed; ideal for local, schema-flexible graph data
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
🧪 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.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"))
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"))
📄 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.4.tar.gz
(45.7 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.4-py3-none-any.whl
(53.7 kB
view details)
File details
Details for the file coffy-0.1.4.tar.gz.
File metadata
- Download URL: coffy-0.1.4.tar.gz
- Upload date:
- Size: 45.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ee796d7066d1ff19bc104a4c1f386feddb36942dafbbf81555de7ac6671d755
|
|
| MD5 |
01eec69b0fc6eabd2502e37498cb38dc
|
|
| BLAKE2b-256 |
1b42b18e1720b503fdad9aa3809557e9a4cd27db2d2a0ec45f341d1b7fe1c631
|
File details
Details for the file coffy-0.1.4-py3-none-any.whl.
File metadata
- Download URL: coffy-0.1.4-py3-none-any.whl
- Upload date:
- Size: 53.7 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 |
fbb85e003ba0a52547228f3460bb84fe00fb1552b9ce5da262e5dfcde62c0f97
|
|
| MD5 |
2f3bc4591498907814195102c4248c20
|
|
| BLAKE2b-256 |
04f7209e99ef643c1549bab3a39bd96193f39c944dae64cb21fcf103db424b16
|