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

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pylance-0.2.7-cp310-cp310-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pylance-0.2.7-cp310-cp310-macosx_10_15_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

pylance-0.2.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pylance-0.2.7-cp39-cp39-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

pylance-0.2.7-cp39-cp39-macosx_10_15_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

pylance-0.2.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pylance-0.2.7-cp38-cp38-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

pylance-0.2.7-cp38-cp38-macosx_10_15_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

File details

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

File metadata

File hashes

Hashes for pylance-0.2.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 37a5e82924bb7e3bb7e1173bb4488aaa6533bae627414ba9db7e998cac4d9b6c
MD5 f03c16138f7eb0e92601a070b9ea10f5
BLAKE2b-256 27d6255542b0e97029f3082d2ea7bb141ce4c2ecd3dd765a889ebd058d425d32

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.7-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 02d09efe85e705d75c9345da9bc553a190bbb22e672f0090651b4709ab5d334a
MD5 65055a5b4aa56372929e92c328958bf1
BLAKE2b-256 2715217c33af30273199eff1d5c30f1334ba27b7f3d841d91fb8e3bb6d4521ae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.7-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 3ac94095c4a34d7f56678f0228fa9f60d8bedc64fbe12b48d48094221ebf6b66
MD5 b0387683bbb64711717c0d1a70733cac
BLAKE2b-256 896ccaf17216bb3b5ebae17c0a1719ab774711ba3e2bbbe8b4426f777264f7eb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dee20d827cfa01358e10a992fc26c0487c41ce9b21b519a71504945fdd7867a3
MD5 eb56e5709173b0bb8244a9d0a1de927e
BLAKE2b-256 3b52694f88f0ef234a716740eb1f5a3ef5500a1917a73d6853d65ca89616d9f4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.7-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a15fed4d1538b27db3f0d4b668c36423cacf2e8e9fef6ef6307f85de5d3aeb1d
MD5 b2a4ec8254ae3d23b3f53698fa374267
BLAKE2b-256 e73478cbdbef29435351781a65aa1da74eac1164dccc734fc972ff9d14b89454

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.7-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 fad994402e09a9058aa5b0ccbbb6c186f3b48627d96663dbd7854c4466a698cc
MD5 5bbb0895c000d8f58e94140cb8505d44
BLAKE2b-256 6e73908379b37713f8a3d42be18b87553d7d94745986aa8ce1e9c45ead513371

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b860e27fdb90d76452b665bb9980aaa36ba22acbf9b9609381306e1a32c83a0a
MD5 1e16e8fb05a34beec91e8c02d95a987b
BLAKE2b-256 1746c74a4e19a124c14c661f54226196966823be33e06eb33a14fce6ad379595

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.7-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4e7d4a3813be1fbf321dd9c8c127c103233e5a615ba20581f1f8d86606bb3cf4
MD5 e0b6d052233779a5ed40f667d2859f43
BLAKE2b-256 1a016613817b4c8afc8a5d024d934a8e9ac4e325443148a5bf51574fb1f79db3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.7-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 3da64e630aac5a47bfa1713a019afac1020e6df7edf5f0eaa5a05602562c947b
MD5 e81ef86825f7bbef3a8972f2bb379e71
BLAKE2b-256 78dd56b4d59d17aed015970fe76bfdf5af0d5193b1a38792431983ada5f693be

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