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 minimal wrapper over SQLite for executing raw SQL with clean tabular results
  • coffy.graph: An in-memory 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 file-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
  • Returns clean structured output, easy to extend

📄 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.0.tar.gz (33.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.0-py3-none-any.whl (42.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: coffy-0.1.0.tar.gz
  • Upload date:
  • Size: 33.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.0.tar.gz
Algorithm Hash digest
SHA256 05edcff280febb39c3d5ed775efdbf6daabb90d774b9811ce515248d729998f7
MD5 7b9f9eb1460e0f767fd3f7ba3ce55a5b
BLAKE2b-256 192ad70c0be4133db2c9ed8102f6a0a9ccf8d1a32c96510f7567c4b1ff30b50e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: coffy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 42.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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 95a3ed8566c85188a58e62c3cd992d4744aa8f617b868fc585758338c407a7a1
MD5 cf153c7067c9343e5a2bb08865a48b73
BLAKE2b-256 0c145fff80c09c648e23f9449102a21eddf06576f69a339f0cbe0c770193555d

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