MCPcopy Index your code
hub / github.com/CassioML/cassio

github.com/CassioML/cassio @v0.1.10

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.10 ↗ · + Follow
320 symbols 1,685 edges 50 files 42 documented · 13% updated 7mo agov0.1.10 · 2024-10-03★ 10944 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

cassIO

A framework-agnostic Python library to seamlessly integrate Apache Cassandra with ML/LLM/genAI workloads.

Note: this is currently an alpha release.

Users

Installation is as simple as:

pip install cassio

For example usages and integration with higher-level LLM frameworks such as LangChain, please visit cassio.org.

CassIO developers

Setup

To develop cassio, we use poetry

pip install poetry

Use poetry to install dependencies

poetry install

Use cassio current code in other Poetry base projects

If the integration is Poetry-based (e.g. LangChain itself), you should get this in your pyproject.toml:

cassio = {path = "../../cassio", develop = true}

Then you do

poetry remove cassio                                      # if necessary
poetry lock --no-update
poetry install -E all --with dev --with test_integration  # or similar, this is for langchain

Inspired from this. You also need a recent Poetry for this to work.

Versioning

We are still at 0.*. Occasional breaking changes are to be expected, but please think carefully. Later, a stronger versioning model will be adopted.

Style and typing

Style is enforced through black, linting with ruff, and typechecking with mypy. The code should run through make format without issues.

Python version coverage

At the moment we try to run tests under Python3.8 and Python3.10 to try and catch versions-specific issues (such as the newer typing syntax such as typeA | typeB, illegal on 3.8).

Publishing

  • Bump version in pyproject.toml
  • Add to CHANGES.txt
  • Commit the very code that will be built:
  • git tag v<x.y.z>; git push origin v<x.y.z>
make build
poetry publish  # (login to PyPI ...)

Testing

Please run tests (and add some coverage for new features). This is not enforced other than to your conscience. Type make for the available tests.

To run the full tests (except specific tests targeting Cassandra), there's make test-all.

Unit testing

make test-unit

Integration with the DB

Ensure the required environment variables are set (see for instance the provided TEMPLATE.testing.env). You need at least one of either Astra DB or a Cassandra (5+) cluster to use.

Launch the tests with either of:

make test-integration

make test-astra-integration
make test-cassandra-integration
make test-testcontainerscassandra-integration

The last three above specify TEST_DB_MODE as either LOCAL_CASSANDRA, TESTCONTAINERS_CASSANDRA or ASTRA_DB. Refer to TEMPLATE.testing.env for required environment variables in the specific cases.

Note: Ideally you should test with both Astra DB and one Cassandra, since some tests are skipped in either case.

Core symbols most depended-on inside this repo

get
called by 113
src/cassio/table/base_table.py
assert_last_equal
called by 76
src/cassio/table/cql.py
put
called by 62
src/cassio/table/base_table.py
execute
called by 44
src/cassio/table/cql.py
resolve_session
called by 39
src/cassio/config/__init__.py
resolve_keyspace
called by 38
src/cassio/config/__init__.py
get_partition
called by 35
src/cassio/table/mixins/clustered.py
ann_search
called by 34
src/cassio/table/mixins/vector.py

Shape

Method 211
Class 50
Function 50
Route 9

Languages

Python100%

Modules by API surface

src/cassio/table/base_table.py50 symbols
src/cassio/table/mixins/metadata.py24 symbols
tests/integration/test_init_astra.py18 symbols
src/cassio/table/tables.py16 symbols
src/cassio/table/mixins/vector.py16 symbols
src/cassio/table/mixins/clustered.py14 symbols
src/cassio/table/cql.py10 symbols
tests/unit/test_multicolumn_primarykey.py9 symbols
tests/integration/test_tableclasses_metadatacassandratable.py9 symbols
src/cassio/vector/vector_table.py9 symbols
src/cassio/config/bundle_management.py9 symbols
tests/integration/test_vector_table.py8 symbols

For agents

$ claude mcp add cassio \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page