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.2.5

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

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.10 macOS 11.0+ ARM64

pylance-0.2.5-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.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.9 macOS 11.0+ ARM64

pylance-0.2.5-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.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.8 macOS 11.0+ ARM64

pylance-0.2.5-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.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pylance-0.2.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d3b3cd47382ab8598d13c3631f96c528aa81443e58e7b4aed110e67e52c18878
MD5 821c9747b6ac2ca9d040645d244e9261
BLAKE2b-256 93cf1710a0e9bbd12e3149ad117b47f3d307f0003be0c038b45c9bd0d4e319cf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.5-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b2ae671f93f6e007c440170b6a934b900f364f105e074d9aedca1c05ab74ec90
MD5 b344268246964b79d1950dcba0a5bc15
BLAKE2b-256 47628adb92dd832c1d65b1049873c2eecbf7b171f9802917210e3edcb0976b41

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.5-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 521a029b93a8d56d4184613e2b70b0da5b121ac0f6d71e08a853d6e8127ba64c
MD5 c649d056f9db07cfc340177a6b1ec04e
BLAKE2b-256 69a63bcab3063c766e6820a7d8bc317858fb8a8a75c1a9a01005d772f33cbc84

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3e0254bc823f5bb4e07a141fd3985fb3a2b7997764bd1d634657d21a16ca4100
MD5 de7f1a1e206509eda4dfc00fa9859adc
BLAKE2b-256 efbc2f7ad9808978476b5c99e07b29c4cadf41bfc2ba9514f24779209128225d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.5-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1e035c1d9fbc11e4236c7d5a2f3b3c00373a941b85cfd31e103a3dca2e7226f9
MD5 286426376ebc7ffdcbf401a27774b66e
BLAKE2b-256 e8591034e196b5e9b7e74c826b2514e4bb26cbfdefed849f75847dd7eafed1da

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.5-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 410586783fdb1e0f017784aed27a56f639393ced18ca943c0e50b2d712b644db
MD5 9841027272941f627d6817f890311b7a
BLAKE2b-256 842b595a8d73ab59288d4c34a7ce1bd1be2d27e4e57b40a17308ee9599d18fba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 903b566f33b7d767f3c6a49fbe4e248f495386a3413248fd95f12f1fc30833ee
MD5 e8929e5771e981da55b3c53b88b93c62
BLAKE2b-256 eaa508266bc10c83ee3395b9579941db51f41977f7de972f14ef9e37424f1bdd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.5-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b13e9ea248534aa25c8a978ea6fb72e7cbd2881f5ec3632ba510f904e2b0a227
MD5 036f27d85ebb55caf1ee53b712d4e891
BLAKE2b-256 39e370cd22c721e068ddf93ebb4ce94d0c40d86d2fee095c2a1e3e1f1b80dd97

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.5-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 e0fb130612479d2c0e2c52a1d1fa7fef5b92063683d611dc7a8ed6d86010b1f5
MD5 2e55cfb1768e4754128ca87794c64b32
BLAKE2b-256 1ce102b71631adea7e851db02f124fe6c1581fc02477b3f6809d84581ba4c045

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