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

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

pylance-0.2.4-cp310-cp310-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

pylance-0.2.4-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.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

pylance-0.2.4-cp39-cp39-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

pylance-0.2.4-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.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

pylance-0.2.4-cp38-cp38-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

pylance-0.2.4-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.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pylance-0.2.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3dbbfd6031133435803e3c2f4cb9c9f64c9903cc820e3bef06e6bbe4ff07f57f
MD5 319ebfd89bf3214baf762f87ddb1e8af
BLAKE2b-256 10270bd0b4fac42256cdf3f1aa3b735c8d8a769a995c2d10bfc38f77d374f3a0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.4-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2ca14b78b9c50b722c39bf03611bb8240a7bc165b79cea2b2e6a79b3150ac892
MD5 97234bcf1230babcdfc4a91756122320
BLAKE2b-256 c262d233870c5fef61b07808ac50717044505ad1a8438845b417f7f4bbf9fdd6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.4-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 2cee4bf628069fcf6d4bb9021ef3a1365b7b01a571389809ae245e343661de51
MD5 76f7ab45ebbbd5237a0563dd61636e85
BLAKE2b-256 e9875dd0481b2f404e20a0b19e7007688f01ab86d3a59e0fc7c4c740f6cf08c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f4098213e4735c4bf0529f678d6dd31e0784a033acddba50a699668eab964e43
MD5 7b471ddf8a520b516c750ce01b004217
BLAKE2b-256 84aba7718d86c1aab8fcea60c5027a620da271f18f4dc45248cd65150ecf2f62

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.4-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 86008be013a773f0eb02aa068d062a45f8bb1fa00e7e6113563dff13e190de30
MD5 57fad199c926d9f4ba053f661c15fa7e
BLAKE2b-256 f9cbdd23d761119b3821ab9e556831fe7aac675dde9bf738624d27d27a4c6dbb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.4-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 137cd9742b60fe5eeca9a4dd0cca5c21a40bee6a7f81f84ed6f50908f7866a21
MD5 e1fef8701da6c30ab4e1230ff2f9a879
BLAKE2b-256 09b57e17fe41b36765c970799cf60116c1a939b5e8c21469b96b86d2942a73f2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 95adb7ba6519d259144d21ec5c65d75138e67bb5c543e2dfea88935789e76afc
MD5 159a7fc4fa55dedf1129ffb5eb41ce60
BLAKE2b-256 c288c92cde70f9dfaabeb741bd0a0098d29f51c1fb513477425ed031839d3ee6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.4-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8e89a4ed93b8814e7195e357a3073a0c6effcc36f1f7612a42f82ba1617dbf41
MD5 eeb5ceef7d30eb1fcca7864a475ddc52
BLAKE2b-256 f4e8aa59771feedfc5d26858855189ac35a27ac9343138482f8d70ca27a5bc05

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pylance-0.2.4-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 cb7a868a71859a270a5dd2586916f24b6aa52f28630a9e77b5a7788408103a8e
MD5 7c006a1fa9094b503055836885ef7506
BLAKE2b-256 b7bbed939a23c187b949b0b55e8e4f1332a37da165d96877cee7915048196e4c

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