Skip to main content

No project description provided

Project description

object-store-python

CI code style: black PyPI - Downloads

Python bindings and integrations for the excellent object_store crate. The main idea is to provide a common interface to various storage backends including the objects stores from most major cloud providers. The APIs are very focussed and taylored towards modern cloud native applications by hiding away many features (and complexities) encountered in full fledges file systems.

Among the included backend are:

  • Amazon S3 and S3 compliant APIs
  • Google Cloud Storage Buckets
  • Azure Blob Gen1 and Gen2 accounts (including ADLS Gen2)
  • local storage
  • in-memory store

Installation

The object-store-python package is available on PyPI and can be installed via

poetry add object-store-python

or using pip

pip install object-store-python

Usage

The main ObjectStore API mirrors the native object_store implementation, with some slight adjustments for ease of use in python programs.

ObjectStore api

from object_store import ObjectStore, ObjectMeta

# we use an in-memory store for demonstration purposes.
# data will not be persisted and is not shared across store instances
store = ObjectStore("memory://")

store.put("data", b"some data")

data = store.get("data")
assert data == b"some data"

blobs = store.list()

meta: ObjectMeta = store.head("data")

range = store.get_range("data", start=0, length=4)
assert range == b"some"

store.copy("data", "copied")
copied = store.get("copied")
assert copied == data

with pyarrow

from pathlib import Path

import numpy as np
import pyarrow as pa
import pyarrow.fs as fs
import pyarrow.dataset as ds
import pyarrow.parquet as pq

from object_store import ArrowFileSystemHandler

table = pa.table({"a": range(10), "b": np.random.randn(10), "c": [1, 2] * 5})

base = Path.cwd()
store = fs.PyFileSystem(ArrowFileSystemHandler(str(base.absolute())))

pq.write_table(table.slice(0, 5), "data/data1.parquet", filesystem=store)
pq.write_table(table.slice(5, 10), "data/data2.parquet", filesystem=store)

dataset = ds.dataset("data", format="parquet", filesystem=store)

Development

Prerequisites

Running tests

If you do not have just installed and do not wish to install it, have a look at the justfile to see the raw commands.

To set up the development environment, and install a dev version of the native package just run:

just init

This will also configure pre-commit hooks in the repository.

To run the rust as well as python tests:

just test

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

object_store_python-0.0.7.tar.gz (31.9 kB view details)

Uploaded Source

Built Distributions

object_store_python-0.0.7-cp38-abi3-win_amd64.whl (2.8 MB view details)

Uploaded CPython 3.8+ Windows x86-64

object_store_python-0.0.7-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.0 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ x86-64

object_store_python-0.0.7-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.7 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ARM64

object_store_python-0.0.7-cp38-abi3-macosx_11_0_arm64.whl (2.6 MB view details)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

object_store_python-0.0.7-cp38-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (5.4 MB view details)

Uploaded CPython 3.8+ macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

object_store_python-0.0.7-cp38-abi3-macosx_10_7_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.8+ macOS 10.7+ x86-64

File details

Details for the file object_store_python-0.0.7.tar.gz.

File metadata

File hashes

Hashes for object_store_python-0.0.7.tar.gz
Algorithm Hash digest
SHA256 1120d2f2d0373291d0c14d62df1f4fb65b97cc979fb3fce424f626ef816893f1
MD5 ff2c9827b54e1090e71f23096737ba37
BLAKE2b-256 e3f872f58e2909e3ea83cc0ff38e88a538ce9c4715a9dd3be7a13addf53e1b7d

See more details on using hashes here.

File details

Details for the file object_store_python-0.0.7-cp38-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for object_store_python-0.0.7-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 c3ea0aae19545ab36d6f54299010bcd6f22ee92a21b36fbe3daf20dfd9082e49
MD5 7f7e1b848e677c1a4f1e7b6e4e26b50e
BLAKE2b-256 57e587a5cffa9f3157873559457a77ddeb4d243c15ade8dd296c600a39127c55

See more details on using hashes here.

File details

Details for the file object_store_python-0.0.7-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for object_store_python-0.0.7-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 57b4bbbef71cc8f888ef88c201e867644ab3dde769086f95f705db6c695482ae
MD5 ac3fd64a20d7eb2844ac4f5153445387
BLAKE2b-256 f273d4609e6fdef49676e3c787a28f27da2f85c1028bc417df3205f2bfbaa2ba

See more details on using hashes here.

File details

Details for the file object_store_python-0.0.7-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for object_store_python-0.0.7-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ce92bfb07ec7cae481b38f47353726b6d5c3b19794b34b6e47123e7238434e5e
MD5 9e22b9a4b6a13498d1327dd0d061f027
BLAKE2b-256 c6d4615534b12d2d5bc32a75c6e612c6434e687bcc572d0f136e5e93c33691d1

See more details on using hashes here.

File details

Details for the file object_store_python-0.0.7-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for object_store_python-0.0.7-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e6a6372a24c4c42463ef340ec5e01d664a4626256ffb1070adb6b593bbb1ff56
MD5 4a3681b5fa8b4d48db60ee126da5d69f
BLAKE2b-256 3754b4bfcae6154aeac311d27323049bec36cfeaef42132e98d0892bea627a31

See more details on using hashes here.

File details

Details for the file object_store_python-0.0.7-cp38-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for object_store_python-0.0.7-cp38-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 1a11f1a4cc597b72c4eea3f20a8deb8fa8ee2935c248af20e987d3fe0bb94f9a
MD5 53f5faf632e643d6954e04ed69f75b7d
BLAKE2b-256 b1e44e6027a3f93c19259fa315a703edab14ce4221f9ec0160cb4f3784293abb

See more details on using hashes here.

File details

Details for the file object_store_python-0.0.7-cp38-abi3-macosx_10_7_x86_64.whl.

File metadata

File hashes

Hashes for object_store_python-0.0.7-cp38-abi3-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 b981cf375090c0d8f71a3d07c0503b8608a154f972f5cffa09578aade38bcc32
MD5 f53a5eb6c61b2f60cf5c2735af35e2f0
BLAKE2b-256 6567efdede9d9e129c198dfcefe49cd85f8498ccd817e8b68587ea64cad33b1f

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