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.graph: An graph engine built on networkx with advanced filtering and logic-based querying
  • coffy.sql: A wrapper over SQLite for 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

📄 NoSQL Documentation →


coffy.graph

  • Lightweight, file-backed graph database using networkx under 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

📄 Graph 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 →


🧪 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


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.5.tar.gz (45.7 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.5-py3-none-any.whl (53.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

Hashes for coffy-0.1.5.tar.gz
Algorithm Hash digest
SHA256 3a99f55516009d83e1846395bea4b11906a6b11af45397ac84269f96c9eb88a4
MD5 6dc45f2382cc9947c9cf3ec323df7f40
BLAKE2b-256 55bf7fad598527e233bcda2bd544b5160eef8cec2db49be4a7a1e0ba73ac403b

See more details on using hashes here.

File details

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

File metadata

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

Hashes for coffy-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f3cce581e22b7b62fb7f81da3410a2bd52fae60be8afcb046f1294dda481e4ba
MD5 d146d723f8cc6e637b1159aa73c4e8fa
BLAKE2b-256 81c1c7742315fda5daf0819397cd834d44adef7b12d3ad0547f6f983774fc954

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