Skip to main content

Lightweight local NoSQL, SQL, and Graph embedded database engine

Project description

☕ Coffy

PyPI version

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.6.tar.gz (54.3 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.6-py3-none-any.whl (60.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: coffy-0.1.6.tar.gz
  • Upload date:
  • Size: 54.3 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.6.tar.gz
Algorithm Hash digest
SHA256 45d643045ed8c94d8e2e07660ddfd5c27adc54168bf4b332b80d091cd4922b37
MD5 38ccd7e1867507f09f9e81c029ddd8f3
BLAKE2b-256 1820e9cab640f0916008c890fc460c2dcfdc9426ac6ebd2370a7d47110f16fdb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: coffy-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 60.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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 508452f76c2d86fdba8bbcf9ba84bcaedb5252c463b68b8510d967a8d8979cea
MD5 d42ad40933f894efa89848cb2c533114
BLAKE2b-256 c8d251f9f61aef110957c2e867e72e16054d6a00f57450709a96b1f8202ee92c

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