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

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pylance-0.2.3-cp310-cp310-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pylance-0.2.3-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.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pylance-0.2.3-cp39-cp39-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

pylance-0.2.3-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.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pylance-0.2.3-cp38-cp38-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

pylance-0.2.3-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.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pylance-0.2.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e55ab3cc7b3092f7a80303244dcbe1a18516a4fdbce9cb21996c1d4011798f81
MD5 fab36c189dd127a9e91c34d2a868cede
BLAKE2b-256 68563a4e737e9833a744150d0ac6c62201e022150256a44d4c51e1984a4e5ee9

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.2.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a7cdb78006f7940717365a3bf1e222cebc49886e5ec7fbe61c8de3f66e438b3d
MD5 3fdb53f65569da63aed61245d423b8fa
BLAKE2b-256 ceb52d09cc1f9974b39dcefef7ef58be5e0f2b87bf1e2de73985bc2c5e62fa15

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.2.3-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 70f88c64e8e8f14b4a6e008b2c21c640c1a040c71f05c5a511a697c78c28e15d
MD5 8a90aebe9aa15150e7a2c3e8bbf8039a
BLAKE2b-256 b7b6a3840f8caeb9a9f8edc512a4ccb35adb1ed881a0f09274d1459ae1da0163

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.2.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9be49a44090b41ffba78f0683cc201fd02e4a0de4774128bf25e0d19954c67ea
MD5 e3c77a51a890c6a36605a7becd4beb84
BLAKE2b-256 cbf41015f4778b1ecdbdde12b834e690b39b7f36266513c511145bbf6085a181

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.2.3-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b485e511042a3954747f9ec4230ed2421c0bc09bac61ea049c88991502a43fdc
MD5 0417c30af49c3babed4a79d3fee3ab04
BLAKE2b-256 0afe721d11bd1aab454b821c3e1abc9299d40bb2ddf51f4ae5db4c2a0ffb4a3f

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.2.3-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 f1fa91e6bde26697a0f7828ec86a105c103dce82798de7cfe0375dea7edfc0db
MD5 9b481bdb0b69bc4af43609dd6d77bcc5
BLAKE2b-256 f472a3846051e1228e2731bc3f39b90e2cf8e76208aea8e0fb290b022259a313

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.2.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 46aed848e2961b96a63238dbdc6398056da26a28931efc9794ed3cd9cb0f6416
MD5 85d422b5d812e65fe9c63240e5e660f6
BLAKE2b-256 374921cdd006a077a8fc46e4df221710bba266ef619ee0773f93909bdad6dc55

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.2.3-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6bc980a3a71c6c6156cc470b6e160893606c53a5cae205a27aa9b57a1b317786
MD5 b9d84dadba223144b4730474aca5d562
BLAKE2b-256 078e9990327a3b7c07597b393fd2d415f42aea9318089f1b63b3b6e3db5f5ed8

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.2.3-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 13352af1e4db8ca46b7dd9f0994875f88311a20eeb27683c9d5658634abae186
MD5 9f80d0b517ea12f0825c6e0dde0bf0b1
BLAKE2b-256 3166d801326bf5f75a70baf32fbf02a47faf917621ab6820b1fe53b0b6493dfb

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