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

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.10 macOS 11.0+ ARM64

pylance-0.1.4-cp310-cp310-macosx_10_15_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

pylance-0.1.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.9 macOS 11.0+ ARM64

pylance-0.1.4-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.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.8 macOS 11.0+ ARM64

pylance-0.1.4-cp38-cp38-macosx_10_15_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

File details

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

File metadata

File hashes

Hashes for pylance-0.1.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7c1a412b3215e20bd1ce89f767ecd7b1e60cacbb71074e8bd67ee984ece0ba73
MD5 caa79322e1ee1035ad1c7f49c3019ead
BLAKE2b-256 6ca163b1a31199d4c4daa2d1983d398e511120e0c96522792a74c1dc1d492906

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.1.4-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7a4c918f1c889289b2aa61e694d9817bc72cab345b973f9960d4b6bcb114dec6
MD5 f2cb08b24d65ad30d07e3cca80779eef
BLAKE2b-256 c52cdc982ba7e2ab9477aa92072115d72662a7a9f32f1af76077bdd2219fde69

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.1.4-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 8509b5f436eaaebe13d222575c279c32cd9d9bff60c752b74e96d276c0852836
MD5 b722c3cf4c6ea63955b7195bd17d0b1a
BLAKE2b-256 5e7fe2f91ce41f7af98440028e24411239d2a220dcc4b233b77d0457982e999f

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.1.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2dbec02e91b4949cff4e70ac834b551060aaf7d3433c2b52f0b3cae3d6d9fa4a
MD5 3d661ac1696c51abeba6f7bbf8844461
BLAKE2b-256 7f291c2f89cc9d7f068f5cf21247c87b21457b7157355a31846da3f4f7e9ba75

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.1.4-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0189ff4a3a7b56ad8fdd33b2d1889c9c886bc43ed454d9db5b6e216421f3e27b
MD5 21ddf0bd2699909484bb02dc045f978b
BLAKE2b-256 489f014d321835f5ed6622583a301b9d64fb154bb84c068ade96531587cc2ea7

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.1.4-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 cfaab796cd1ba6c9f56a1d1974490958fc2c78cc12995a0472bac671d6333bb4
MD5 fce6f9dea3fb748534e5c1ec158915b1
BLAKE2b-256 902120ca911bcde7c118e2bca3612bf00f1e44b01b0a8188bfa168384312c3bd

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.1.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e4a1fda6f24b8b39eaa2af480c84a0eb610622de61b51449a469594eafb7f041
MD5 6ddbfa4c43608eee656f1eb4ab884b30
BLAKE2b-256 8fe990d3ee8ddc2de2e811e43387d9a77dcfec700bb8f209a4c2be26731cd713

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.1.4-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4858b77db18f7b452fe8c752b1f812e7217dbc8ed9a4234cfd07835a68c53ecd
MD5 798527208a24536704effa655e2cf9d5
BLAKE2b-256 6d178abcc1d1341718904f5ba3806dc46c46ab63804613223e8f0ff66c8448fe

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.1.4-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 23daaef9eecc029cac4032f2642b5defa821afbeff00f897b94a85fd7134e2cb
MD5 b9571c12c9b88107044289706df59450
BLAKE2b-256 613b9dc1bc8e38c0d93e831658d595ad236906f34b8383b495b9b97d13553085

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