Skip to main content

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 interface
  • coffy.sql: A wrapper over SQLite for executing raw SQL with clean tabular results
  • coffy.graph: An graph engine built on networkx with 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 .json files

📄 NoSQL Documentation →


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

📄 SQL Documentation →


coffy.graph

  • Wrapper around networkx with 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

📄 Graph Documentation →


🧪 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


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.1.tar.gz (34.6 kB view details)

Uploaded Source

Built Distribution

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

coffy-0.1.1-py3-none-any.whl (43.5 kB view details)

Uploaded Python 3

File details

Details for the file coffy-0.1.1.tar.gz.

File metadata

  • Download URL: coffy-0.1.1.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

Hashes for coffy-0.1.1.tar.gz
Algorithm Hash digest
SHA256 6064037d92740125ca148e667db8d9125cd03d61075bacd2a91372184b8c50fe
MD5 ad9edf9d7ba9ed833248de894400d534
BLAKE2b-256 fe718ff23a5f63049a20a54cac4bab2ce94d35e226283d541bbd27f32303a7e6

See more details on using hashes here.

File details

Details for the file coffy-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: coffy-0.1.1-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

Hashes for coffy-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ace4f62102cf7a274bef433be0b0d937415b261d7b453098800573e54bbdf441
MD5 da53bf0059c81d7bc7f19a4fe587613f
BLAKE2b-256 d6c09e1290da6706f5073fbe5ea3c7eb817216c2aede57b667fa0ca9eca77b0d

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