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.2.6-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.6-cp310-cp310-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pylance-0.2.6-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.6-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.6-cp39-cp39-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

pylance-0.2.6-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.6-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.6-cp38-cp38-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

pylance-0.2.6-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.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pylance-0.2.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 779a730b8692a93ac3218d7addf714c67dc798389e24f3b99db32d4c3264b0f9
MD5 193884e791c26e175533a671f67ff774
BLAKE2b-256 265415333bc5cea8dca9e362f7efb1b86a14ea918a323e1ec0e9e06615850cff

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.2.6-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2bad69c7ebd58260d7f3668c65e250a6551618b26448d75ddb1ca4b06edff3ea
MD5 1d5bd8b0868c4cdb5d864d043d948f0d
BLAKE2b-256 9b3ba0d8ea655c934e65b27e8a55a8640b5c81c64dd95642fd37458025b8999a

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.2.6-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 85fb3236a56773439c732f075b8dcf656bc6f1f850e3bb9d4f9291a4bbe2ebc5
MD5 cd46a19bff4d604ab7e889b572e3a77b
BLAKE2b-256 1bbe7160c97b58faf522bd2ab6c1505b93b5b73683c0e8068e39e409e1888ef6

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.2.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 07a5e9aa173260452f78bc5e8922d697a82e2e7d25dd1edf759396b10da22779
MD5 2397f13a35e081115cc33b009812436e
BLAKE2b-256 2ab9f83c24cf52f48220d0f841af8b639eff4732b857bf0a91b7b2ec61afac54

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.2.6-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 77b0a60354ce193bab840e1caef17e8680582c14aae9cbf44fc4701883c3a289
MD5 302d455b50ff3d6b2eb99a6df9dbeb7d
BLAKE2b-256 2b15d776ec18f3fb72746757f94eaba6ec88c75ad9301dc2bc365bb0c6685a54

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.2.6-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 6f88319cc436cce4d1ee632b5163da46205ce9adfc95c2c0121351c732774165
MD5 8d36dcdad57c5e5bcd2791692f82999b
BLAKE2b-256 a739789338303ef5f6ded7149d07c915a5be1b508b97846d95cb2d8c319729bf

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.2.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 269876b8b70c9ab27ad4cc795527ba7c34dda762931e141da9cc14d6a4f137c7
MD5 a02f9d56c00fabfc8713845cea66bdea
BLAKE2b-256 94b50d2ddac96ded09f5efbbdc7424fd7730d4d68d0dd1496fe88a8b9d68dc2f

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.2.6-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b39370cf21601dc01567e0ea3afb3877574d6a6210beb9869af2525d90f4b60e
MD5 2afca1be6d204d62373be55aea2186c1
BLAKE2b-256 842a5efa4fb626f8174613950eb030f9af0f0e8179e442cf6d7c68920449262e

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for pylance-0.2.6-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 105ac18d04ba90f673e22cd4e56ad51052e74e7e482b5b49d444c395fbbbcd49
MD5 6b78717d0d0305a0b1dd9637ec6344a6
BLAKE2b-256 ee293d5ec01ead4f383a78e71eafdccf1a08a2ed6b595f978160cb0c9b6a6c23

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