chromasql


Namechromasql JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummarySQL-like DSL for planning and executing scoped ChromaDB queries.
upload_time2025-11-01 14:32:43
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseNone
keywords chromadb sql dsl vector-search
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ChromaSQL

ChromaSQL is a lightweight SQL-flavoured DSL that makes it easy to express
queries against ChromaDB collections. It wraps ChromaDB’s `collection.query`
and `collection.get` APIs with a familiar syntax and provides utilities for
parsing, semantic planning, execution, and multi-collection fan-out.

## Features

- Lark-based parser that converts SQL-like strings into typed AST nodes.
- Planner that translates the AST into validated `QueryPlan` objects ready for
  ChromaDB execution.
- Thin executor that orchestrates vector and filter queries, applies ordering
  and pagination, and normalises result rows.
- Optional multi-collection helpers and adapters for routing queries across
  sharded datasets.
- Analysis helpers for extracting metadata-driven routing hints.

For a clause-by-clause walkthrough, see `TUTORIAL.md`. Additional usage notes
and examples live in `EXAMPLES.md`, while edge cases for OR-based routing are
documented in `OR_ROUTING_EDGE_CASES.md`.

## Installation

```bash
pip install chromasql
```

## Quickstart

```python
from chromasql import parse, build_plan, execute_plan

query = parse(
    """
    SELECT id, document
    FROM products
    USING EMBEDDING (TEXT 'mesh office chair')
    TOPK 5;
    """
)

plan = build_plan(query)
result = execute_plan(plan, collection=my_chroma_collection, embed_fn=my_embed_fn)

for row in result.rows:
    print(row["id"], row["document"])
```

## Development

We publish `chromasql` from this monorepo. Use the helper scripts in
`scripts/` to build wheels, upload to PyPI, or synchronise the public mirror.
See `CONTRIBUTING.md` for architectural background and testing guidelines.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "chromasql",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "chromadb, sql, dsl, vector-search",
    "author": null,
    "author_email": "darshitac11 <darshitac11@gmail.com>, cruxcode <swaroopshyam0@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/e4/4b/34943ea0db75d4b9729eec0483e938e042a2290a4e914e421a3763310ec2/chromasql-0.1.0.tar.gz",
    "platform": null,
    "description": "# ChromaSQL\n\nChromaSQL is a lightweight SQL-flavoured DSL that makes it easy to express\nqueries against ChromaDB collections. It wraps ChromaDB\u2019s `collection.query`\nand `collection.get` APIs with a familiar syntax and provides utilities for\nparsing, semantic planning, execution, and multi-collection fan-out.\n\n## Features\n\n- Lark-based parser that converts SQL-like strings into typed AST nodes.\n- Planner that translates the AST into validated `QueryPlan` objects ready for\n  ChromaDB execution.\n- Thin executor that orchestrates vector and filter queries, applies ordering\n  and pagination, and normalises result rows.\n- Optional multi-collection helpers and adapters for routing queries across\n  sharded datasets.\n- Analysis helpers for extracting metadata-driven routing hints.\n\nFor a clause-by-clause walkthrough, see `TUTORIAL.md`. Additional usage notes\nand examples live in `EXAMPLES.md`, while edge cases for OR-based routing are\ndocumented in `OR_ROUTING_EDGE_CASES.md`.\n\n## Installation\n\n```bash\npip install chromasql\n```\n\n## Quickstart\n\n```python\nfrom chromasql import parse, build_plan, execute_plan\n\nquery = parse(\n    \"\"\"\n    SELECT id, document\n    FROM products\n    USING EMBEDDING (TEXT 'mesh office chair')\n    TOPK 5;\n    \"\"\"\n)\n\nplan = build_plan(query)\nresult = execute_plan(plan, collection=my_chroma_collection, embed_fn=my_embed_fn)\n\nfor row in result.rows:\n    print(row[\"id\"], row[\"document\"])\n```\n\n## Development\n\nWe publish `chromasql` from this monorepo. Use the helper scripts in\n`scripts/` to build wheels, upload to PyPI, or synchronise the public mirror.\nSee `CONTRIBUTING.md` for architectural background and testing guidelines.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "SQL-like DSL for planning and executing scoped ChromaDB queries.",
    "version": "0.1.0",
    "project_urls": {
        "Documentation": "https://getadriai.github.io/chromasql",
        "Repository": "https://github.com/GetAdriAI/chromasql"
    },
    "split_keywords": [
        "chromadb",
        " sql",
        " dsl",
        " vector-search"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3c72ba3e75437119cf6a07b461854672351cbe513a4b5247432909ac1a7ea0fa",
                "md5": "d3dfebc520f12979b45a15c11dfa5e8b",
                "sha256": "757321e0c802f1926fff3118ffe178eaf33f5e14e4e1a5a08685fb90ddfb4787"
            },
            "downloads": -1,
            "filename": "chromasql-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d3dfebc520f12979b45a15c11dfa5e8b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 29691,
            "upload_time": "2025-11-01T14:32:41",
            "upload_time_iso_8601": "2025-11-01T14:32:41.494201Z",
            "url": "https://files.pythonhosted.org/packages/3c/72/ba3e75437119cf6a07b461854672351cbe513a4b5247432909ac1a7ea0fa/chromasql-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "e44b34943ea0db75d4b9729eec0483e938e042a2290a4e914e421a3763310ec2",
                "md5": "0acecae996bff768a3faefbcc165994c",
                "sha256": "d4b82c5e840f0d8a69c0387492d9c03184d3807ef2d13092027118103007bdd4"
            },
            "downloads": -1,
            "filename": "chromasql-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "0acecae996bff768a3faefbcc165994c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 25836,
            "upload_time": "2025-11-01T14:32:43",
            "upload_time_iso_8601": "2025-11-01T14:32:43.214223Z",
            "url": "https://files.pythonhosted.org/packages/e4/4b/34943ea0db75d4b9729eec0483e938e042a2290a4e914e421a3763310ec2/chromasql-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-11-01 14:32:43",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "GetAdriAI",
    "github_project": "chromasql",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "chromasql"
}
        
Elapsed time: 2.84787s