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

If you're not sure about the file name format, learn more about wheel file names.

pylance-0.2.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.10macOS 11.0+ ARM64

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

Uploaded CPython 3.10macOS 10.15+ x86-64

pylance-0.2.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.9macOS 11.0+ ARM64

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

Uploaded CPython 3.9macOS 10.15+ x86-64

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

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.8macOS 11.0+ ARM64

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

Uploaded CPython 3.8macOS 10.15+ x86-64

File details

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

File metadata

File hashes

Hashes for pylance-0.2.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b7a3e56344684df4e83dac03b90f65ca6321e3cf082082ec22bcd5041c1e8038
MD5 e2d14e17f0dc3eb829f250a79217e397
BLAKE2b-256 da4f93e5c928550219c196282abed7fa1e100913f55967bc36e7b59f0a166cf7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.8-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8b4e9c2862dbe5f5536fa34d4a70abf5ffcb7f548f5b126df7a29f58a68e77e3
MD5 9a9894a6ba314c15eec1ccbf2e9a12c3
BLAKE2b-256 78a624ba7d9e85c4fb6760d5e731c526d00f17330801d96dd232a4cf912cbaff

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.8-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 6ee3c5e402a1187234b16f0ba53d795b88d5d1daf268b1236d5c908cd1e5f990
MD5 9243fddd52b59c26bfd416870468f540
BLAKE2b-256 4085dcfac2c5eda887a992e00a586c817f943323a5727dced243afaea46c9c80

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fe1ecb58098d1ab943c9896d105b133a18cd09813cd859158c260849a765a24d
MD5 63e3b9a7e2c41ee660acb3a24f41adfb
BLAKE2b-256 f0386959397eee4e00d292121fbab509b055b9a7debfeb704558d5ffc125c8ae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.8-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 84a7f71d7236a13ace3eda314df503718a798cb223064649e97c4dc386b1bee2
MD5 9baf2d706e5ca5474cbd0ac97f153140
BLAKE2b-256 fbf84a07413b9c7f5f0810a3dbf8cc0f68030dbdd425bb47ba1ee865d763b73f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.8-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 40327fde66a27f3d9ec5fbf5e30012c26a96e8bf51c9e639e6bcfc70da5a8b5c
MD5 017399b330d8b60f0d549a9c477f8d4d
BLAKE2b-256 9a738fa108e3ff3f96b226b445694394008c2b0ef517f1330271bd600a748256

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dbe2f8ada33abd1548f3db6698e5df232cab5a461e004741ff28b50f15eb32c7
MD5 592fc204e74046a157ace371765ab9af
BLAKE2b-256 52476c1573eec8c3fd515edca9879a7015a8dab34e432abda2980a49a1794a23

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.8-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2b2f755a676fcb3a1e62442e44441fba2ed413a9647ecf062b81c8eac348302c
MD5 8858ea9c52498b0b1fccb92f95abf847
BLAKE2b-256 f7caa09ef33b94750494a3d0ce4566da10abeae95baeb680eaa17157db4e720b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.8-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 8eca96fa6d1c68bf5d2e56cb87bc3bb03658204117b68e795c192dec4bc0cd09
MD5 8767b254c124876f92bb1956e0bc7679
BLAKE2b-256 d12b82707b1f77bbed984c95cc68506a2520ec48cb91f24586350c5ff50bc100

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page