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

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

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.10 macOS 11.0+ ARM64

pylance-0.2.0-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.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.9 macOS 11.0+ ARM64

pylance-0.2.0-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.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.8 macOS 11.0+ ARM64

pylance-0.2.0-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.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pylance-0.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 566a3919d696d5f733048ebaf5e411af3bf7c6d6d7f65a5e0c9ae70be5336314
MD5 adc1ac82fd282ee1659801db79b5d70b
BLAKE2b-256 a374ec983c77221af4594a63c9999dbcd43616dee4c6c8b46ca9894e9d643478

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9eb90cd31976dcc8bdf4908fb18239ee4b8a5cfff92301e21cf313be18459bcd
MD5 ea063cdf505ff690bdf5ea03149e278b
BLAKE2b-256 f777d03ec3723f663e5d73ad682df90d29309bad50221f39423898b56f7ed763

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.0-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 c0782a99d64de05efa2fa76c7b6c87077a7c42003adff03bb4509dd5a769ab40
MD5 bf1ca36c3e85739de4272cb39003b79b
BLAKE2b-256 8c4ab56d0c5aa71498e569ff57b72a0768bdf2c9eeee00970618bc347f45f3b1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1472c14c5e210f49849030903e98f05c496932fa9aef85f7257b87dc9cc9f17c
MD5 f27c1253059e374b604447b3c6a45c4a
BLAKE2b-256 18f9581d1cc033b51976fa37923eec3df1ebd90c6657c181426408945c42c4a9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 85f3be856bdc51764bc2a0645152dc82a0bd703d2e221bb49494269650a17856
MD5 ab3d0dcfa546929d6765d24e3ae0cb21
BLAKE2b-256 565dcd17863676525ff0512b7f3b66a3fb49f85ec562a16dc720d9cc5e89098d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.0-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 049660e4f91deb14a5afb7a599d7808c9f893f4ffcb461a2f18815b64254c7eb
MD5 02dbb56aaa6d36e217217b8a6039364a
BLAKE2b-256 c002f32b34763da038d250458568ca2644d061f5cb283dfca4ef81294040f14b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6199c82150be3dbd24f7547121258329901514a51cc599145e0cf08170b0dd11
MD5 70c3c1d3c0ff41b95558838a6e2c4224
BLAKE2b-256 57437d9ade321cbd483ece05ea975d7fdeb00f54f99610e351b76465f69a454c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 148465de9e85d3b0f9ccebe369c8ac42d7e805c44c433c1bbf330ba4a01f0a41
MD5 181baec18d22542086fc8bd6288f7dff
BLAKE2b-256 e9faab489c050c79d3f7fa705cd1315f638cecfab28af72b15378fd1f2a6cd73

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.0-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 efc813a2b101fced44cd4e71ad7bf3b03cc5ec113130f4a03c12e89604780ed1
MD5 680f6b432e11d05fd98b590af7bd1356
BLAKE2b-256 acc314c49d32bb3640a07fb6a7561577e50527fa1cef4d8560d281f603a1e90f

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