Skip to main content

Python extension for lance

Project description

Python bindings for Lance file format

Lance is a cloud-native columnar data format designed for managing large-scale computer vision datasets in production environments. Lance delivers blazing fast performance for image and video data use cases from analytics to point queries to training scans.

Why use Lance

You should use lance if you're a ML engineer looking to be 10x more productive when working with computer vision datasets:

  1. Lance saves you from having to manage multiple systems and formats for metadata, raw assets, labeling updates, and vector indices.
  2. Lance's custom column encoding means you don't need to choose between fast analytics and fast point queries.
  3. Lance has a first-class Apache Arrow integration so it's easy to create and query Lance datasets (e.g., you can directly query lance datasets using DuckDB with no extra work)
  4. Did we mention Lance is fast.

Try Lance

Install Lance from pip (use a venv, not conda):

pip install pylance duckdb

In python:

import lance
import duckdb

# Understand Label distribution of Oxford Pet Dataset
ds = lance.dataset("s3://eto-public/datasets/oxford_pet/pet.lance")
duckdb.query('select label, count(1) from ds group by label').to_arrow_table()

Caveat emptor

  • DON'T use Conda as it prefers it's on ld path and libstd etc
  • Currently only wheels are on pypi and no sdist. See below for instructions on building from source.
  • Python 3.8-3.10 is supported on Linux x86_64
  • Python 3.10 on MacOS (both x86_64 and Arm64) is supported

Developing Lance

Install python3, pip, and venv, and setup a virtual environment for Lance. Again, DO NOT USE CONDA (at least for now).

sudo apt install python3-pip python3-venv python3-dev
python3 -m venv ${HOME}/.venv/lance

Arrow C++ libs

Install Arrow C++ libs using instructions from Apache Arrow. These instructions don't include Arrow's python lib so after you go through the above, don't forget to apt install libarrow-python-dev or yum install libarrow-python-devel.

Build pyarrow

Assume CWD is where you want to put the repo:

source ${HOME}/.venv/lance/bin/activate
cd /path/to/lance/python/thirdparty
./build.sh

Make sure pyarrow works properly:

import pyarrow as pa
import pyarrow.parquet as pq
import pyarrow.dataset as ds

Build Lance

  1. Build the cpp lib. See lance/cpp/README.md for instructions.
  2. Build the python module in venv:
source ${HOME}/.venv/lance/bin/activate
python setup.py develop

Test the installation using the same queries in Try Lance section.

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

pylance-0.2.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pylance-0.2.9-cp310-cp310-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pylance-0.2.9-cp310-cp310-macosx_10_15_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

pylance-0.2.9-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pylance-0.2.9-cp39-cp39-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

pylance-0.2.9-cp39-cp39-macosx_10_15_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

pylance-0.2.9-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pylance-0.2.9-cp38-cp38-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

pylance-0.2.9-cp38-cp38-macosx_10_15_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

File details

Details for the file pylance-0.2.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pylance-0.2.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fc34e8fda2b00b7abee21fce6e31071425d12a420300ea0684771c0f256506b4
MD5 7eddd3ca7edb7b324bbbc622bbbf9022
BLAKE2b-256 aabcb7a74190c77a3b5aaa1eb7fb28e409015be652db465b97acc24c7affe7b1

See more details on using hashes here.

Provenance

File details

Details for the file pylance-0.2.9-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pylance-0.2.9-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8910d32227af416bf3f43d501f418b39e0fb93e3c910e81d7206518914c2dd21
MD5 3aa5c9aebd88c55edd2db9bd0a4fec43
BLAKE2b-256 01c841b46f29f1ba95fa75fe9c1058dac2991416d17a5f4dd5211316ef8799b0

See more details on using hashes here.

Provenance

File details

Details for the file pylance-0.2.9-cp310-cp310-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for pylance-0.2.9-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 3f8b845a24a275a45bd8b9f95bcd34cffd07b2656e378cf29a0f5787c4da3c6b
MD5 ca6bd491ee50252efd5bdc44b358af6c
BLAKE2b-256 7c725dbf9b7367208f2e25ffeb1a12f535ff66d23831ded8ad7ce71252573357

See more details on using hashes here.

Provenance

File details

Details for the file pylance-0.2.9-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pylance-0.2.9-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b40079cef75bcae487909ae1968e5b7cfde4a93c192a3e98ed0c54b469bcbb17
MD5 29c72dbde9709ec005be19f23b2b4a12
BLAKE2b-256 c4aafac51fdc4aee502ee62a12694d6cb0e19ea2daa11c2c8a95588b85153965

See more details on using hashes here.

Provenance

File details

Details for the file pylance-0.2.9-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pylance-0.2.9-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 356ed153c47dc10dd65d10da270a112d302928efc8b42584a8b07914e07efb85
MD5 5f6b338ae0e8d6633d8ad8a5f3b1f339
BLAKE2b-256 528caec264871c4844c9c64618bad0ace247ff8cd7e009ce8c6aec5cc6a23ba1

See more details on using hashes here.

Provenance

File details

Details for the file pylance-0.2.9-cp39-cp39-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for pylance-0.2.9-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 570e3832e2c0f35803fa9691a5cddcd4c59c5c2c3b773fcf16d09293d4a224bb
MD5 c632ea90689453ca95b168cf5fa88275
BLAKE2b-256 7145b048d42935d98d9908add20af21a00265ad6a4395c0a4c3ca029112b400e

See more details on using hashes here.

Provenance

File details

Details for the file pylance-0.2.9-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pylance-0.2.9-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 00ba88cb6e0c61e580e0ad835a01c5f262933490e7f6d6117e468f03e3d1bb56
MD5 3a053770ee96a692d5610bba9fac70da
BLAKE2b-256 38c7b912a488ebc0609b53492e87cbc983ab55ced5404666c920dec807a27053

See more details on using hashes here.

Provenance

File details

Details for the file pylance-0.2.9-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pylance-0.2.9-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 20abda4ac283e6340273b5d1aaac5f0b33c7201d52b17f9126f693e2da12ec97
MD5 be9764ced6600528447cf02e4b8e65a9
BLAKE2b-256 4c65e75b236371d756944103c634991785606d3b4cd353b7a60789d1dfa37bc0

See more details on using hashes here.

Provenance

File details

Details for the file pylance-0.2.9-cp38-cp38-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for pylance-0.2.9-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 13d860eb2ec29a130e3a8b49cbdefb3bfd01296f7e98d051efa22e9cc98c40af
MD5 b156d6b5e11478ff360207e32ef8640d
BLAKE2b-256 34b3c44cddfd9a536cb630115cebcd4664aaaec77384e26e413f04aa69301553

See more details on using hashes here.

Provenance

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