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

This version

0.1.2

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

Uploaded CPython 3.10 macOS 11.0+ ARM64

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

Uploaded CPython 3.9 macOS 11.0+ ARM64

pylance-0.1.2-cp39-cp39-macosx_10_15_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

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

Uploaded CPython 3.8 macOS 11.0+ ARM64

pylance-0.1.2-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.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pylance-0.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5eb238276334201888e3c22a8aa23e6ffb3483ea21a856ac15f7551d59ef4a2f
MD5 dc7d5c70c6383cb1aa4cd5be3bba8399
BLAKE2b-256 247b6e06b7a589cdf499aee8b51076fc5b2a08daec085732ca8d93fb00d4b79e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.1.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e49cad17efe5a499663ab2a3005ac2167050886d8e592c00bd3034c504803489
MD5 6922f6cfdb1faf2bca0b38bab0a2b31d
BLAKE2b-256 a94c82d4a8daae558d8f76e1fc8dfa0ee5626e9c99094dbd9a9b544601eb2d44

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.1.2-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 971efc816ef79476be21144b1d2eb4853a97631778d820da0bdb1fda06a076f9
MD5 66debc7ce103b39d1e3a8a7ba573ff76
BLAKE2b-256 aa9ece4e9480a1f136ddc3a40022b98a6ee05c52acba5ed50a8cbcb5972b6a86

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1580c306e5c2a1d5cdc0380c7586ada9bdfef9f508da48f2d23d57c21ec5b09e
MD5 9213cc2b5de37b6df215f4df6f6b3829
BLAKE2b-256 49ac967b8bb4cbeb496474d105ffdd9d6dfb8b6dc239b911596bd9aecb865f78

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.1.2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cc844ae7b6a6ee6103146633eb06de89b551370c3a1b6507f53836f8bc638543
MD5 da7e9f90efb2a8d3a5de009cd70ffdf8
BLAKE2b-256 8e8b902ab44a209bbb18b2446976e96ee89a672c19fda9f47cc4dd405162d569

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.1.2-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 2b0df507a00036ba76e5f5c804f93a9db933a503458c856910c5597d6a5ea9dd
MD5 b536a6b809448fd1e3004d9c17fc0810
BLAKE2b-256 a096dadc128e10cdc7ffac42faed1f4c34798f045f458ffda96fed3663105ddf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3889f31762e9f972584a9178ccac45bb1c7f2718ae46dff5f1a5a873cd7436b6
MD5 e543d19622f02286b27e74691ceea321
BLAKE2b-256 14b409ed55ccc882d4894043a7b273c2e1b0d3054262eb7ff3d28bdbba8c1e1e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.1.2-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b467d2b5d8bf6aa5a290c1b3114601189f32c94ae2deda434769e53a71fbaf89
MD5 6bcf318bca9f1555e292ba106a059209
BLAKE2b-256 f01ed26c6277c3c19af3138f83cde0f40d2f6ea9afa574674a65196768712864

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.1.2-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 3358eeb875d8aab08c4571ed55b47c174a5b01043fdfc9e264459a94787b2911
MD5 58fa02c578cf2f9d71b4933f7d413417
BLAKE2b-256 5de69c1b464a5b5bd9c4c3c28b568f5a6edffc8efe27e150a8773dff2e8092f8

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