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

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

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.10 macOS 11.0+ ARM64

pylance-0.1.3-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.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.9 macOS 11.0+ ARM64

pylance-0.1.3-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.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

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

Uploaded CPython 3.8 macOS 11.0+ ARM64

pylance-0.1.3-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.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pylance-0.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c04f0360fb84e8ff59080e252cbc9f1ee6af3e3dccd132a03723fd9ad553e4f2
MD5 638d2ffe8bcdfbbda96885f83dc7ea5c
BLAKE2b-256 c9992986b0ff5027a8a9600e770a0da2a1e21d6bc00e1ecbaaa42456ddaa47ed

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.1.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9b95bb17beefd2dc5a7fea4beb8deb9e596c5e7a4654153f4becc969daa694b6
MD5 48d2588708958ab8a64fb5620a4df4f1
BLAKE2b-256 db0a6a0704ca6cbb48055274120afc0c666433f43f9f07b9f7dc46bda8b3d0e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.1.3-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 9fb1bf07b21f171e5c3c4feed4f5d356362a3641069456db98e5a4809f8c4dc5
MD5 f40d6593717c425fba756f294e53c46e
BLAKE2b-256 969f854dfa0096918d837bae3df72fc951a27a6f9257f73ed796854de96fe0be

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.1.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 05f6a5e51ef2441801a156317149c26b753f63d11e76868bbf786ea85bf2a0d8
MD5 8f0fcf5c95b69122b133124f09f8f3ee
BLAKE2b-256 8af7359b589ac9a0a6c0fe864fcb01639e733139eef520d56a2d4cab68eca2ae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.1.3-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 77f4e909d2b369b1d7290500cd09bb3ee67f9865bb8e542b1e85da49207b1a37
MD5 7dd93585c244f602c1274aee9f0240d2
BLAKE2b-256 43218347cf9413ec33bc7979c20e2eafc4e7c6fd328ccd7ea0c5cf250a015a15

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.1.3-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 fba7d16db67f6088acf88c3dfd8f51d6b813a008f3739bec52977ccf404d7e12
MD5 376b68b5b9afa55a2737b4d25d9f1760
BLAKE2b-256 97efbb2de85c2f0a092ecb65de8b069da008071640deaf1ddbba34cd28cb3c2d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.1.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e568e8a0064da55be7e9d5e3f6bd50ac0888315f748b47a98aa4d76af754a35a
MD5 30ec59832a4b56256e08ea8c62e6c399
BLAKE2b-256 a7ebeae95e2a6fe5656d4ca9b1cec944437eadac96837d20c9c0b59248fa0a8c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.1.3-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1e4e212ec0ecdd6cb41fa86d8f80d7f70f417aaa6a447be2d763f1ac4ee270bd
MD5 3efd4253acc402e07105d907455425c3
BLAKE2b-256 2c474835afb9aa9410aaa8fcfe80e4d19cd3c33796ba0c945c1b2bd112d85375

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.1.3-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 c9ec3d282c916df8e9cf8ed95ecfd95d78a44a1321320d9eef47ca5f4a46b84e
MD5 a9453439cd43475d2219b7a5579f3bd1
BLAKE2b-256 70725c0934f6cddda2965fd6859b3dbf027dbee1851a70fde851ecc030087a1a

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