Skip to main content

Python binding for delta-rs

Project description

Deltalake-python

PyPI

Native Delta Lake binding for Python based on delta-rs.

Installation

pip install deltalake

NOTE: official binary wheels are linked against openssl statically for remote objection store communication. Please file Github issue to request for critical openssl upgrade.

Usage

Resolve partitions for current version of the DeltaTable:

>>> from deltalake import DeltaTable
>>> dt = DeltaTable("../rust/tests/data/delta-0.2.0")
>>> dt.version()
3
>>> dt.files()
['part-00000-cb6b150b-30b8-4662-ad28-ff32ddab96d2-c000.snappy.parquet', 'part-00000-7c2deba3-1994-4fb8-bc07-d46c948aa415-c000.snappy.parquet', 'part-00001-c373a5bd-85f0-4758-815e-7eb62007a15c-c000.snappy.parquet']

Convert DeltaTable into PyArrow Table and Pandas Dataframe:

>>> from deltalake import DeltaTable
>>> dt = DeltaTable("../rust/tests/data/simple_table")
>>> df = dt.to_pyarrow_table().to_pandas()
>>> df
   id
0   5
1   7
2   9
>>> df[df['id'] > 5]
   id
1   7
2   9

Time travel:

>>> from deltalake import DeltaTable
>>> dt = DeltaTable("../rust/tests/data/simple_table")
>>> dt.load_version(2)
>>> dt.to_pyarrow_table().to_pandas()
   id
0   5
1   7
2   9
3   5
4   6
5   7
6   8
7   9

Develop

maturin is used to build the python package.

To install development version of the package into your current Python environment:

$ maturin develop

Build manylinux wheels

docker run -e PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig -it -v `pwd`:/io apache/arrow-dev:amd64-centos-6.10-python-manylinux2010 bash
curl https://sh.rustup.rs -sSf | sh -s -- -y
source $HOME/.cargo/env
rustup default stable
cargo install --git https://github.com/PyO3/maturin.git --rev 98636cea89c328b3eba4ebb548124f75c8018200 maturin
cd /io/python
export PATH=/opt/python/cp37-cp37m/bin:/opt/python/cp38-cp38/bin:$PATH
maturin publish -b pyo3 --target x86_64-unknown-linux-gnu --no-sdist

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

If you're not sure about the file name format, learn more about wheel file names.

deltalake-0.2.0-cp36-abi3-win_amd64.whl (4.8 MB view details)

Uploaded CPython 3.6+Windows x86-64

deltalake-0.2.0-cp36-abi3-manylinux2010_x86_64.whl (6.4 MB view details)

Uploaded CPython 3.6+manylinux: glibc 2.12+ x86-64

deltalake-0.2.0-cp36-abi3-macosx_10_7_x86_64.whl (4.8 MB view details)

Uploaded CPython 3.6+macOS 10.7+ x86-64

File details

Details for the file deltalake-0.2.0-cp36-abi3-win_amd64.whl.

File metadata

  • Download URL: deltalake-0.2.0-cp36-abi3-win_amd64.whl
  • Upload date:
  • Size: 4.8 MB
  • Tags: CPython 3.6+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/0.9.0

File hashes

Hashes for deltalake-0.2.0-cp36-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 d37b60edc92512e9a0bdd912388b39f3fc1d59f30c101e2a4d1e764eab88cf99
MD5 3d8d5a8e8528c6868506c61590d95738
BLAKE2b-256 a61544cadb10b7cb1bf977968fcf392e8e2322d945ff5cbe10313e5da5b3a840

See more details on using hashes here.

File details

Details for the file deltalake-0.2.0-cp36-abi3-manylinux2010_x86_64.whl.

File metadata

File hashes

Hashes for deltalake-0.2.0-cp36-abi3-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 1bf968c8f4942560205291948bf5211929c555b59b76ecc09a3044645ceb052d
MD5 d1c993d4fcb0c41b1a9b1ebdc04e6898
BLAKE2b-256 f961d10976663e2d99771920c520e856e68dd7f08cda3b3fb8e7a1c0e5513142

See more details on using hashes here.

File details

Details for the file deltalake-0.2.0-cp36-abi3-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for deltalake-0.2.0-cp36-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 2413c256509e09dc9ea7dd7b57d880e39485ab3dcc35a4bac9f65731f53951b7
MD5 a791de21ae1e15d7954c943b0b69a65e
BLAKE2b-256 e6ad7b34e96d0aa5de38eb46819c0ddcab6317418938b95ecd880fecea550db3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page