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

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pylance-0.1.0-cp310-cp310-macosx_11_0_arm64.whl (13.0 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pylance-0.1.0-cp310-cp310-macosx_10_15_x86_64.whl (14.6 MB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

pylance-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pylance-0.1.0-cp39-cp39-macosx_11_0_arm64.whl (13.0 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

pylance-0.1.0-cp39-cp39-macosx_10_15_x86_64.whl (14.6 MB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

pylance-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pylance-0.1.0-cp38-cp38-macosx_11_0_arm64.whl (13.0 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

pylance-0.1.0-cp38-cp38-macosx_10_15_x86_64.whl (14.6 MB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

File details

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

File metadata

File hashes

Hashes for pylance-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f176681fd439f6c44d931bb79670c1f1f539e05c5927865aa8135f33a7ceabb2
MD5 9844cfb16248350499ecf962364e9fdc
BLAKE2b-256 9a923abfa9ba940c4b172d1b9c3c70ab9fce970003bdaf744707976651c0255b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 069689b1a3ff96c1cc0f1e03e126919826b0de60d8ba7a68c679db46ba26bce9
MD5 01f72c80e2c61b06e11eeb0c054240fe
BLAKE2b-256 e2c62ec080803dbb0f28c3e60b2d09b127abc599499757f4311ee6f9081e5173

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.1.0-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 ed4f6943459de3ad5a1a209c01b56bc89cec9e3d6b8d69bf70d6441a1aecdeb4
MD5 f7f10a26726ef60b4aa5b400e680eb6f
BLAKE2b-256 ba958b1fd231ad365b192add37485ff7ccdc51854665c245dd7e0fe5b3416ffc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 912277ca0b8293b24d45a31396217afba6e42c9221d66d157cb38c15c282fe51
MD5 493ccc7a3189c2d50192745b125e569f
BLAKE2b-256 8103d259f47e5fb5134fe32ca7293d2c552b1513f0a621c86d346d4249da7a1e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.1.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 da859e66cbed8370d0efb2daa6a1efc51c6b6f4e9e13de2bfe8893ea923d7976
MD5 48415338f444ba83d1ea9f62ffef3ebc
BLAKE2b-256 b0960a3ca984af9b87dca99d87b6a0575a3d22bcc09165cd19adca5b7c6231bb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.1.0-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 3d0ce3ca82ed73e4afe9d61bce08e2f6d3a11f44f091df3fdace60b10ee9f599
MD5 a0502920f255b6cd7c133e02045b245a
BLAKE2b-256 ebcfe58b8b0a308b46f3350dbae7a1474c30099629ed4821870ac4966b813daa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 da6372b101a0172eb46ac31f25be293814c2c0331f24f58883dedb2161ca4720
MD5 060d385f4a91fcf5666fa87837599c0e
BLAKE2b-256 8461253d02298ab4f90af66afde9b2eecf4ccc33d849c6f24af104d19462a341

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.1.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 db8e04be1353d093b1c04843eb78dff5f9e332547b99ef50875582aa84fc4b07
MD5 9faacecfc15e870937bfe194c3342160
BLAKE2b-256 df187049c798303d1f72c6aba1e12144374e2f6f08bb2cafa2a5bb3dd3c4656f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.1.0-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 c31abfbe62b55e03e7f2b842e2b8a9d6f16d088d8cc34888855d2051627ac997
MD5 9becd1631177878cc905ae265166ea47
BLAKE2b-256 523a5431ecf8f4ad980fd0c1341973a46f1dc675736bb9e5322873b427cc5cf9

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