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

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pylance-0.1.1-cp310-cp310-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pylance-0.1.1-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.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pylance-0.1.1-cp39-cp39-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

pylance-0.1.1-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.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pylance-0.1.1-cp38-cp38-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

pylance-0.1.1-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.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pylance-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6566830352a637f44f128411691cc196242536e539e6a2d529b695d145e3ad87
MD5 63c04ef55ac37281c3e9c18e7cf3f885
BLAKE2b-256 6d4e29cfe2b3b74a5a3c8df51e3057a33f4d392ec91322d70d2de67767e2da30

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.1.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e0255dc85bc20623bb69b573f5d180d21c253fa3aa2d0920c503b75576b9bfbb
MD5 3628181a8de0915e2558f0121272ce1e
BLAKE2b-256 0d95613f79829e813054523659b8b071e04cee944aceeb8741c09a892865bcb7

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.1.1-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 76cee0750f68f8dcee3ce82b960b6225d4218e1e3c31b0202c0dcc74157b5c03
MD5 388d3a902b3644068043a4c81a05c215
BLAKE2b-256 a3a769d214ae98d2aaf38a86f2b07113c7fe1bef9e5a0400e491af5de4cf75b9

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 318ad218ea91c7d44d9736a771704db6a837f46d0c095abed522275a3a202f4e
MD5 ba1a28af798c990721f168357f28232a
BLAKE2b-256 e4a86a01fb338b0b6dab0528f2bc6301ed2ebf58f16957f343dc39fd53572f7d

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.1.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3135347b80943eb4e52618e9a85a18ed8e9a68ee5dd4e93490b20d175b2f17fe
MD5 fa983d41404e4e0c4215c85f74799944
BLAKE2b-256 acf69349038c2dd6e6eab2eb275a0d3b647796fe839cd4162c51ba0fccc87aae

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.1.1-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 df5d6d160f1cb2b94c358b056e17e4290de6750baebdaf6b125bec2323d3a3d0
MD5 d368d325b05aa901b4f6fafddd331260
BLAKE2b-256 15a14e35852ded8aa14b0b0c5b82af731fd63da994a28033d01cbc35a0807520

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d70a6a088d2a388479c6ba09d96797fe6b605a42372031bcdad92ae0c1f7bc6b
MD5 f4d1beb0cce178ccedadcf694ffa9f0f
BLAKE2b-256 9fee9990351db0123c82cd54f000a20ca15cde16b95383cab528654096824d3a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.1.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e62899003d6048e00742d63f3ed84a0ae8bb7a19d583bbdbf027c842a7ce95ce
MD5 6b37d6f18bdb02984ebcd10db1daf0ab
BLAKE2b-256 cfb1686d3303ec0a546d5dfd644fbead6e942cff5ece1c568897438a1aee4a22

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.1.1-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 8a4fafe5d5a17deebd5c8cb25a7bbf0fb42d4e86aeca72d481541c81f37b6448
MD5 ce11c92e9abe72a4ae71c9bcad81aba1
BLAKE2b-256 25120d1bf8cdb4f116e511a6550509547164a50797655c7164927348d0552daf

See more details on using hashes here.

Provenance

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