Skip to main content

lancedb

Project description

LanceDB

A Python library for LanceDB.

Installation

pip install lancedb

Usage

Basic Example

import lancedb
db = lancedb.connect('<PATH_TO_LANCEDB_DATASET>')
table = db.open_table('my_table')
results = table.search([0.1, 0.3]).limit(20).to_list()
print(results)

Development

LanceDb is based on the rust crate lancedb and is built with maturin. In order to build with maturin you will either need a conda environment or a virtual environment (venv).

python -m venv venv
. ./venv/bin/activate

Install the necessary packages:

python -m pip install .[tests,dev]

To build the python package you can use maturin:

# This will build the rust bindings and place them in the appropriate place
# in your venv or conda environment
maturin develop

To run the unit tests:

pytest

To run the doc tests:

pytest --doctest-modules python/lancedb

To run linter and automatically fix all errors:

ruff format python
ruff --fix python

If any packages are missing, install them with:

pip install <PACKAGE_NAME>

For Windows users, there may be errors when installing packages, so these commands may be helpful:

Activate the virtual environment:

. .\venv\Scripts\activate

You may need to run the installs separately:

pip install -e .[tests]
pip install -e .[dev]

tantivy requires rust to be installed, so install it with conda, as it doesn't support windows installation:

pip install wheel
pip install cargo
conda install rust
pip install tantivy

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

lancedb-0.6.13-cp38-abi3-win_amd64.whl (20.1 MB view hashes)

Uploaded CPython 3.8+ Windows x86-64

lancedb-0.6.13-cp38-abi3-manylinux_2_28_x86_64.whl (18.9 MB view hashes)

Uploaded CPython 3.8+ manylinux: glibc 2.28+ x86-64

lancedb-0.6.13-cp38-abi3-manylinux_2_24_aarch64.whl (17.4 MB view hashes)

Uploaded CPython 3.8+ manylinux: glibc 2.24+ ARM64

lancedb-0.6.13-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.8 MB view hashes)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ x86-64

lancedb-0.6.13-cp38-abi3-macosx_11_0_arm64.whl (16.7 MB view hashes)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

lancedb-0.6.13-cp38-abi3-macosx_10_15_x86_64.whl (18.0 MB view hashes)

Uploaded CPython 3.8+ macOS 10.15+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page