Skip to main content

Python bindings for the lance-graph Cypher engine

Project description

Lance Graph Python Package

This package exposes the Cypher graph query interface that wraps the lance-graph Rust crate. Development uses uv to manage dependencies inside a project-local .venv.

Quick start

cd python
uv venv --python 3.11 .venv
source .venv/bin/activate
uv pip install maturin[patchelf]
uv pip install -e '.[tests]'
maturin develop
pytest python/tests/ -v

Development workflow

For linting and type checks:

# Install dev dependencies
uv pip install -e '.[dev]'

# Run linters and type checker
ruff format python/              # format code
ruff check python/               # lint code
pyright                          # type check

# Run specific tests
pytest python/tests/test_graph.py::test_basic_node_selection -v

# Rebuild extension after Rust changes
maturin develop

If another virtual environment is already active, run deactivate (or unset VIRTUAL_ENV) before invoking uv run so uv binds to .venv.

Repository layout

  • python/src/ – PyO3 bridge that exposes graph APIs to Python
  • python/python/lance_graph/ – pure-Python wrapper and __init__
  • python/python/knowledge_graph/ – CLI, FastAPI, and extractor utilities built on Lance
  • python/python/tests/ – graph-centric functional tests

Refer to the repository root README.md for information about the Rust crate.

Run CLI commands through uv run knowledge_graph .... The default uses an LLM-backed extractor; install the LLM extra with uv sync --extra llm (or uv pip install -e '.[llm]') and configure OPENAI_API_KEY. Install uv sync --extra lance-storage to enable Lance dataset persistence. Supply extra options (e.g., base_url, HTTP headers) via --llm-config. Use --extractor heuristic to avoid LLM calls during testing or offline work.

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

lance_graph-0.2.0b1.tar.gz (305.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lance_graph-0.2.0b1-cp39-abi3-manylinux_2_35_x86_64.whl (20.7 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.35+ x86-64

File details

Details for the file lance_graph-0.2.0b1.tar.gz.

File metadata

  • Download URL: lance_graph-0.2.0b1.tar.gz
  • Upload date:
  • Size: 305.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for lance_graph-0.2.0b1.tar.gz
Algorithm Hash digest
SHA256 9453208819fb5628030a58a95c700cef07b8b2aea803cf73852f698cb57ab325
MD5 d3166979b13b4b5e41024252c7f6b2c6
BLAKE2b-256 e6f18aba97f5d8314a171c6a3e24f906b0f39d5872e6323e91d1a81420e01187

See more details on using hashes here.

File details

Details for the file lance_graph-0.2.0b1-cp39-abi3-manylinux_2_35_x86_64.whl.

File metadata

  • Download URL: lance_graph-0.2.0b1-cp39-abi3-manylinux_2_35_x86_64.whl
  • Upload date:
  • Size: 20.7 MB
  • Tags: CPython 3.9+, manylinux: glibc 2.35+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for lance_graph-0.2.0b1-cp39-abi3-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 7172ce157d496f2827d4c7968f8fa111de33f093c635e45ecf28b296230fc906
MD5 ee29b3059d914e4a036c53e3a3614175
BLAKE2b-256 f28cf7fab76b3215a90900aeabff22877fd2819bbd2e5de96593b1ae0e2eb053

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