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.5-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.1.5-cp310-cp310-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

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

Uploaded CPython 3.10 macOS 10.15+ x86-64

pylance-0.1.5-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.1.5-cp39-cp39-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

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

Uploaded CPython 3.9 macOS 10.15+ x86-64

pylance-0.1.5-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.1.5-cp38-cp38-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

pylance-0.1.5-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.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pylance-0.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5a7f8c722d0bfdac75ce40cf11e231437fbbea281fbae3b09eacda29077aadff
MD5 04f76d30a5a716744b35b80289e80e59
BLAKE2b-256 2e280919fb805258d1afc47854f9c87a6ab570927bc743a89e466c66db3ff0c0

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.1.5-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f5322b257a97842248018c3a6c05ae43e44f7dd493603bbc48952b6e7a5e005d
MD5 f49d17a1f52eb67586d4390d34f4125c
BLAKE2b-256 72e29c4d0fa91b6c8d288cb7dca735e9c5d763f364a2236b78a36462513323c3

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.1.5-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 e73cc6c88df6293c2dff3c51c3db470694d690b39c7ec20d9597ebe78e2a6715
MD5 6ebbd40be4879c31f48e5d9b2ab91aee
BLAKE2b-256 72fc0eb236e02d7a4f1f0177bcf8afe8094e0c04b85ea1d4a2e65ed677724e17

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d700b663819750ccf446f473db13b9c57ec369bca1222f607116cc2dd9835711
MD5 5d1a29b2fbef90005a122edaa5abd616
BLAKE2b-256 419223feaa945bdef1b13a94b83c383ad514ae6e64e0c1c060d55dfa85033d52

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.1.5-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3366f9bcb641612bc19cb18fc3ba8132674087b0968abc3e6de35c178d7fa082
MD5 b7045c1082a04b0bd5a27472ff7621fd
BLAKE2b-256 8bbed3f256ef4b4c05b75224aa4b5c4ac0de38041648bcb078345a1c24069997

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.1.5-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 e9b968c0be385ad22f9a184c8bc6ac1c68d22ca514a9524f82b2f8798557184e
MD5 de17d0e2e2b5740f62d6611bfddf7f96
BLAKE2b-256 bb2021402f28dc57d80bc1c38bd6422ada1cccd1135a80567dc0ca08db6024d2

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.1.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f3b711bd24485001ca259ebaa2193b4ef98ac329c3e360ba9e0f3eb96f182f5f
MD5 4c6b061f7225fb31672d3cb62fdcd84c
BLAKE2b-256 7d8bbe58e6f60cf34262e5f2e928f6c6420b18dfd3322ac91bb41b2ec55da8b8

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.1.5-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7b5701bf2ab79f0580ab0e8fe6078c94a0a9045f13ae6196c8e2f5a59cf9a2ca
MD5 eea29edc7abc618559d3d2d5d8daa791
BLAKE2b-256 9ba0ca84cc46bd62101dd344af26e14d3bb33a3cacd00cfe65dc6715ada36dd2

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.1.5-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 d0234aeb6357eaeb593b6d24252e2fa0d00c1e2d328f5d4ce39c95b90ef34f3a
MD5 4b087247f70e894b32b993c90c81a27c
BLAKE2b-256 aead95a1cab232220aee01620e36f6990484209391b92156e8dfe305a718231c

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