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:
- Lance saves you from having to manage multiple systems and formats for metadata, raw assets, labeling updates, and vector indices.
- Lance's custom column encoding means you don't need to choose between fast analytics and fast point queries.
- 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)
- 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
- Build the cpp lib. See lance/cpp/README.md for instructions.
- 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
Built Distributions
File details
Details for the file pylance-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: pylance-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.4 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1cf86acae3ec9e84511e8c891c2b2844e26ecd62e728bb4af01b62bdf847d201 |
|
MD5 | 4d7a4c0ec424025c6d0dbf3c7e8fe6d3 |
|
BLAKE2b-256 | e96919447f59f88a1333deffbf3f5ee7c8e1acfdfb8afc5fea9261334bd50b00 |
File details
Details for the file pylance-0.2.1-cp310-cp310-macosx_11_0_arm64.whl
.
File metadata
- Download URL: pylance-0.2.1-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6508caacd6bc837863b4a9191ee7f48a363e49b288a7f28bd66b88be98f87f68 |
|
MD5 | eadef4a06ed22a717b9db371eeaa06cc |
|
BLAKE2b-256 | 6557dd3080dc60b7118e5c02215f9047a6c5b395b4bee794e703c1946ff28f6a |
File details
Details for the file pylance-0.2.1-cp310-cp310-macosx_10_15_x86_64.whl
.
File metadata
- Download URL: pylance-0.2.1-cp310-cp310-macosx_10_15_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.10, macOS 10.15+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | db54a14dd1fdbba88ab3d568bdfdb9dff3aa1d794d2653c60117a0847ea25a83 |
|
MD5 | c30378bffa43aff5a9a26cc1fbbee14b |
|
BLAKE2b-256 | 8bb4796053ec46eb824841cc310404834fcfebfcea7f9d2369eab228d2656f47 |
File details
Details for the file pylance-0.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: pylance-0.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.4 MB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.15
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44f3d2e58ca4ea896da9fd040990b04d508f39b3092cd9b4f294756617e00a95 |
|
MD5 | d9169d2122f7f0ea9406b238bca4c5e4 |
|
BLAKE2b-256 | 269aa752ff704ca86b269003da15e2f572fbea21cedb90ba9354fa37803fed67 |
File details
Details for the file pylance-0.2.1-cp39-cp39-macosx_11_0_arm64.whl
.
File metadata
- Download URL: pylance-0.2.1-cp39-cp39-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.9, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b83fa5c3bc04508bc0dd53b14d9b3425de096ddf244a66d5f0a09dd308cc11cf |
|
MD5 | f465d456de024d08ec6fdfea8f72b17b |
|
BLAKE2b-256 | c3993c85f6982a6bb50bfd61171cbc511c7397840fddb3395ccae74676d8026b |
File details
Details for the file pylance-0.2.1-cp39-cp39-macosx_10_15_x86_64.whl
.
File metadata
- Download URL: pylance-0.2.1-cp39-cp39-macosx_10_15_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.9, macOS 10.15+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84bab7c9a3017aeff4231c92a10ee82ab7e65d5b154c8544f2438d09dc11c9c4 |
|
MD5 | ddbd3269305bfd3140a6c79cc3049b20 |
|
BLAKE2b-256 | 75624c719d05ff13f5acfec0c298440f71b64bdf4e81329ba0de4331ce16b9c6 |
File details
Details for the file pylance-0.2.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: pylance-0.2.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.4 MB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 700b3f6fd6a9954671cab3eb4fc4f79110fd74d54d2f60f8f4f77bd5288fd7d2 |
|
MD5 | 37d9affb22f938dae714087bf2a3a44b |
|
BLAKE2b-256 | 3f3d9b30cb46b38e290f3358e27d6af43a33949478d029ddb1b900b7087a9931 |
File details
Details for the file pylance-0.2.1-cp38-cp38-macosx_11_0_arm64.whl
.
File metadata
- Download URL: pylance-0.2.1-cp38-cp38-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.1 MB
- Tags: CPython 3.8, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1cc17b8f3214adb256acfd0d7504f2f83c84246ae1f7a93abdd5cf2ddfc03bd4 |
|
MD5 | 8e3f5ce4964e9c20f5361a5b2a9b9679 |
|
BLAKE2b-256 | 90f1a8627cddf2475f25e7bad2bd47d9974bea6047e010282d0dea68d46f83a1 |
File details
Details for the file pylance-0.2.1-cp38-cp38-macosx_10_15_x86_64.whl
.
File metadata
- Download URL: pylance-0.2.1-cp38-cp38-macosx_10_15_x86_64.whl
- Upload date:
- Size: 1.2 MB
- Tags: CPython 3.8, macOS 10.15+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.14
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26c36591d406c47539bd177ede3f85b6447e1b4a6a4846b6d29f042e7c3a4451 |
|
MD5 | 6fd06c1f94b8bbce6ce780d71f8a5a1a |
|
BLAKE2b-256 | 6d265e9a7d20af89454fb0c4e5b65ec8c6c96093f65c4c2c2a7ae1452795516a |