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

This version

0.2.2

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.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pylance-0.2.2-cp310-cp310-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pylance-0.2.2-cp310-cp310-macosx_10_15_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

pylance-0.2.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pylance-0.2.2-cp39-cp39-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

pylance-0.2.2-cp39-cp39-macosx_10_15_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

pylance-0.2.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pylance-0.2.2-cp38-cp38-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

pylance-0.2.2-cp38-cp38-macosx_10_15_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

File details

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

File metadata

File hashes

Hashes for pylance-0.2.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6d092766bb367429a0ba3ca7f5ae6ac4839b6475a71c98bf7296734ac64b4a1d
MD5 e1b7c775d21c1784a540c8c1b5748e5e
BLAKE2b-256 3bbe597f5ceae483b84c7b72191dfd37e35b774d6462d7da629dc3848d74ce0e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f6ae63e070ab85c1067470a99ab48c543b02b15e9595dc207a5d96798d609506
MD5 bdd11183efaa1d7eec9a9a83a7e94546
BLAKE2b-256 d4410899f972db261f3446e9653c3aa9a2936d7a7aab513d4ea63b372e109a80

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.2-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 7f66ae87f130b99a8e3e3bf26094aa0e6f2a96c4fd2d31fc9dc7b046b94474d0
MD5 1825fe3fd968861ff35d62d9583573ce
BLAKE2b-256 7d704fec40cb16c48455e12983f8994925eae4d37c728838883e8a9a3fcc4515

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 454bae3dd9f37251f93d27995d25c222de250c4aff8fc5957cc33e8e0a64335f
MD5 83ff2af1d6e9fb084270f23423c76f3f
BLAKE2b-256 bbf84d2b832b3f1201a2edfd5c0b42253b4bdd8b796d406faf518ee7866ed540

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cc033158b9e841857a1719cf16690a98b300fba2853e8741af94f10626619665
MD5 283ef543de0043a2c6f1665b5faaf841
BLAKE2b-256 82c84064cc4c625565541bc966a3ebec4772fa3e0de4662a1978c0c3de2e071d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.2-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 0bdfa0eb534fce30d6e72fbf12ebf1c895a7d1f460abe628c2a4c7cfdf1248d4
MD5 1eb640eb5c8efbd52730ca31ec5bbd02
BLAKE2b-256 9ba86f2cad11af4684a69961b32d42c4675fd58e8185ebd3e11c4028bf8fdd43

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 93f9bd770c68410d6c870f5dc47b50bca24abc17b26fce85d39b8843f85ce69a
MD5 0f77509d59890c014d7d1a983d37753a
BLAKE2b-256 73c262e75b02ea710acbffd28256775d6dd7ed3040a5ce0a9b213db3f3efcc86

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.2-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ed96181c4117fd08662859af4a32ac166dd0a5a6806ee8cb6e7eb69aea367157
MD5 9dcbac34cbb113a7eed2978cb46f9083
BLAKE2b-256 3692e36adb0733bf29b93a5c5fdfb96bbddeb437d3806d016bad1e7783e4b114

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.2-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 ab3c3c544ea6a468d7c3b1de0c09a76c427435789382c195ad3b172de4df18ff
MD5 c17f6286f8e5166ce5a442467b0cf9fe
BLAKE2b-256 2dab6bce78f21469f6369947e7e3759936d816d0fc90ae700b001d252e55d59c

See more details on using hashes here.

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