Skip to content

Commit

Permalink
Rename package to object-store-py (#41)
Browse files Browse the repository at this point in the history
* Rename package to object-store-py

* fix ci

* more renames
  • Loading branch information
kylebarron authored Oct 23, 2024
1 parent 6b6f666 commit 1d403ea
Show file tree
Hide file tree
Showing 59 changed files with 129 additions and 131 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:

- name: Build python packages
run: |
uv run maturin develop -m object-store-rs/Cargo.toml
uv run maturin develop -m object-store-py/Cargo.toml
- name: Deploy docs
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:

- name: Build rust submodules
run: |
uv run maturin develop -m object-store-rs/Cargo.toml
uv run maturin develop -m object-store-py/Cargo.toml
- name: Run python tests
run: |
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This file is (mostly) autogenerated by maturin v1.7.1
# To update, run
#
# maturin generate-ci github -m object-store-rs/Cargo.toml
# maturin generate-ci github -m object-store-py/Cargo.toml
#
name: Build wheels

Expand Down Expand Up @@ -46,13 +46,13 @@ jobs:
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter --manifest-path object-store-rs/Cargo.toml
args: --release --out dist --find-interpreter --manifest-path object-store-py/Cargo.toml
sccache: "true"
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-linux-${{ matrix.platform.target }}-object-store-rs
name: wheels-linux-${{ matrix.platform.target }}-object-store-py
path: dist

musllinux:
Expand All @@ -77,13 +77,13 @@ jobs:
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter --manifest-path object-store-rs/Cargo.toml
args: --release --out dist --find-interpreter --manifest-path object-store-py/Cargo.toml
sccache: "true"
manylinux: musllinux_1_2
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-musllinux-${{ matrix.platform.target }}-object-store-rs
name: wheels-musllinux-${{ matrix.platform.target }}-object-store-py
path: dist

windows:
Expand All @@ -103,12 +103,12 @@ jobs:
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter --manifest-path object-store-rs/Cargo.toml
args: --release --out dist --find-interpreter --manifest-path object-store-py/Cargo.toml
sccache: "true"
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-windows-${{ matrix.platform.target }}-object-store-rs
name: wheels-windows-${{ matrix.platform.target }}-object-store-py
path: dist

macos:
Expand All @@ -129,12 +129,12 @@ jobs:
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.platform.target }}
args: --release --out dist --find-interpreter --manifest-path object-store-rs/Cargo.toml
args: --release --out dist --find-interpreter --manifest-path object-store-py/Cargo.toml
sccache: "true"
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-macos-${{ matrix.platform.target }}-object-store-rs
name: wheels-macos-${{ matrix.platform.target }}-object-store-py
path: dist

# sdist:
Expand All @@ -147,19 +147,19 @@ jobs:
# uses: PyO3/maturin-action@v1
# with:
# command: sdist
# args: --out dist --manifest-path object-store-rs/Cargo.toml
# args: --out dist --manifest-path object-store-py/Cargo.toml
# - name: Upload sdist
# uses: actions/upload-artifact@v4
# with:
# name: wheels-sdist-object-store-rs
# name: wheels-sdist-object-store-py
# path: dist

release:
runs-on: ubuntu-latest
name: Release
# environment:
# name: release
# url: https://pypi.org/p/object-store-rs
# url: https://pypi.org/p/object-store-py
# permissions:
# # IMPORTANT: this permission is mandatory for trusted publishing
# id-token: write
Expand All @@ -168,7 +168,7 @@ jobs:
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheels-*-object-store-rs
pattern: wheels-*-object-store-py
merge-multiple: true
path: dist
- uses: actions/setup-python@v4
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[workspace]
members = ["object-store-rs", "pyo3-object_store"]
members = ["object-store-py", "pyo3-object_store"]
resolver = "2"

[workspace.package]
authors = ["Kyle Barron <[email protected]>"]
edition = "2021"
homepage = "https://developmentseed.org/object-store-rs"
repository = "https://github.com/developmentseed/object-store-rs"
homepage = "https://developmentseed.org/object-store-py"
repository = "https://github.com/developmentseed/object-store-py"
license = "MIT OR Apache-2.0"
keywords = ["python"]
categories = []
Expand Down
50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# object-store-rs
# object-store-py

A Python interface and [pyo3](https://github.com/PyO3/pyo3) integration to the Rust [`object_store`](https://docs.rs/object_store) crate, providing a uniform API for interacting with object storage services and local files.

Expand All @@ -25,31 +25,31 @@ Supported object storage providers include:
## Installation

```sh
pip install object-store-rs
pip install object-store-py
```

## Documentation

[Full documentation is available on the website](https://developmentseed.org/object-store-rs).
[Full documentation is available on the website](https://developmentseed.org/object-store-py).

## Usage

### Constructing a store

Classes to construct a store are exported from the `object_store_rs.store` submodule:
Classes to construct a store are exported from the `object_store_py.store` submodule:

- [`S3Store`](https://developmentseed.org/object-store-rs/latest/api/store/aws/): Configure a connection to Amazon S3.
- [`GCSStore`](https://developmentseed.org/object-store-rs/latest/api/store/gcs/): Configure a connection to Google Cloud Storage.
- [`AzureStore`](https://developmentseed.org/object-store-rs/latest/api/store/azure/): Configure a connection to Microsoft Azure Blob Storage.
- [`HTTPStore`](https://developmentseed.org/object-store-rs/latest/api/store/http/): Configure a connection to a generic HTTP server
- [`LocalStore`](https://developmentseed.org/object-store-rs/latest/api/store/local/): Local filesystem storage providing the same object store interface.
- [`MemoryStore`](https://developmentseed.org/object-store-rs/latest/api/store/memory/): A fully in-memory implementation of ObjectStore.
- [`S3Store`](https://developmentseed.org/object-store-py/latest/api/store/aws/): Configure a connection to Amazon S3.
- [`GCSStore`](https://developmentseed.org/object-store-py/latest/api/store/gcs/): Configure a connection to Google Cloud Storage.
- [`AzureStore`](https://developmentseed.org/object-store-py/latest/api/store/azure/): Configure a connection to Microsoft Azure Blob Storage.
- [`HTTPStore`](https://developmentseed.org/object-store-py/latest/api/store/http/): Configure a connection to a generic HTTP server
- [`LocalStore`](https://developmentseed.org/object-store-py/latest/api/store/local/): Local filesystem storage providing the same object store interface.
- [`MemoryStore`](https://developmentseed.org/object-store-py/latest/api/store/memory/): A fully in-memory implementation of ObjectStore.

#### Example

```py
import boto3
from object_store_rs.store import S3Store
from object_store_py.store import S3Store

session = boto3.Session()
store = S3Store.from_session(session, "bucket-name", config={"AWS_REGION": "us-east-1"})
Expand All @@ -59,33 +59,33 @@ store = S3Store.from_session(session, "bucket-name", config={"AWS_REGION": "us-e

Each store class above has its own configuration, accessible through the `config` named parameter. This is covered in the docs, and string literals are in the type hints.

Additional [HTTP client configuration](https://developmentseed.org/object-store-rs/latest/api/store/config/) is available via the `client_options` named parameter.
Additional [HTTP client configuration](https://developmentseed.org/object-store-py/latest/api/store/config/) is available via the `client_options` named parameter.

### Interacting with a store

All methods for interacting with a store are exported as **top-level functions** (not methods on the `store` object):

- [`copy`](https://developmentseed.org/object-store-rs/latest/api/copy/): Copy an object from one path to another in the same object store.
- [`delete`](https://developmentseed.org/object-store-rs/latest/api/delete/): Delete the object at the specified location.
- [`get`](https://developmentseed.org/object-store-rs/latest/api/get/): Return the bytes that are stored at the specified location.
- [`head`](https://developmentseed.org/object-store-rs/latest/api/head/): Return the metadata for the specified location
- [`list`](https://developmentseed.org/object-store-rs/latest/api/list/): List all the objects with the given prefix.
- [`put`](https://developmentseed.org/object-store-rs/latest/api/put/): Save the provided bytes to the specified location
- [`rename`](https://developmentseed.org/object-store-rs/latest/api/rename/): Move an object from one path to another in the same object store.
- [`copy`](https://developmentseed.org/object-store-py/latest/api/copy/): Copy an object from one path to another in the same object store.
- [`delete`](https://developmentseed.org/object-store-py/latest/api/delete/): Delete the object at the specified location.
- [`get`](https://developmentseed.org/object-store-py/latest/api/get/): Return the bytes that are stored at the specified location.
- [`head`](https://developmentseed.org/object-store-py/latest/api/head/): Return the metadata for the specified location
- [`list`](https://developmentseed.org/object-store-py/latest/api/list/): List all the objects with the given prefix.
- [`put`](https://developmentseed.org/object-store-py/latest/api/put/): Save the provided bytes to the specified location
- [`rename`](https://developmentseed.org/object-store-py/latest/api/rename/): Move an object from one path to another in the same object store.

There are a few additional APIs useful for specific use cases:

- [`get_range`](https://developmentseed.org/object-store-rs/latest/api/get/#object_store_rs.get_range): Get a specific byte range from a file.
- [`get_ranges`](https://developmentseed.org/object-store-rs/latest/api/get/#object_store_rs.get_ranges): Get multiple byte ranges from a single file.
- [`list_with_delimiter`](https://developmentseed.org/object-store-rs/latest/api/list/#object_store_rs.list_with_delimiter): List objects within a specific directory.
- [`sign`](https://developmentseed.org/object-store-rs/latest/api/sign/): Create a signed URL.
- [`get_range`](https://developmentseed.org/object-store-py/latest/api/get/#object_store_py.get_range): Get a specific byte range from a file.
- [`get_ranges`](https://developmentseed.org/object-store-py/latest/api/get/#object_store_py.get_ranges): Get multiple byte ranges from a single file.
- [`list_with_delimiter`](https://developmentseed.org/object-store-py/latest/api/list/#object_store_py.list_with_delimiter): List objects within a specific directory.
- [`sign`](https://developmentseed.org/object-store-py/latest/api/sign/): Create a signed URL.

All methods have a comparable async method with the same name plus an `_async` suffix.

#### Example

```py
import object_store_rs as obs
import object_store_py as obs

store = obs.store.MemoryStore()

Expand All @@ -109,7 +109,7 @@ assert obs.get(store, "other.txt").bytes() == b"hello world!"
All of these methods also have `async` counterparts, suffixed with `_async`.

```py
import object_store_rs as obs
import object_store_py as obs

store = obs.store.MemoryStore()

Expand Down
4 changes: 2 additions & 2 deletions docs/api/copy.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copy

::: object_store_rs.copy
::: object_store_rs.copy_async
::: object_store_py.copy
::: object_store_py.copy_async
4 changes: 2 additions & 2 deletions docs/api/delete.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
::: object_store_rs.delete
::: object_store_rs.delete_async
::: object_store_py.delete
::: object_store_py.delete_async
18 changes: 9 additions & 9 deletions docs/api/get.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Get

::: object_store_rs.get
::: object_store_rs.get_async
::: object_store_rs.get_range
::: object_store_rs.get_range_async
::: object_store_rs.get_ranges
::: object_store_rs.get_ranges_async
::: object_store_rs.GetOptions
::: object_store_rs.GetResult
::: object_store_rs.Buffer
::: object_store_py.get
::: object_store_py.get_async
::: object_store_py.get_range
::: object_store_py.get_range_async
::: object_store_py.get_ranges
::: object_store_py.get_ranges_async
::: object_store_py.GetOptions
::: object_store_py.GetResult
::: object_store_py.Buffer
4 changes: 2 additions & 2 deletions docs/api/head.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Head

::: object_store_rs.head
::: object_store_rs.head_async
::: object_store_py.head
::: object_store_py.head_async
12 changes: 6 additions & 6 deletions docs/api/list.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# List

::: object_store_rs.list
::: object_store_rs.list_with_delimiter
::: object_store_rs.list_with_delimiter_async
::: object_store_rs.ObjectMeta
::: object_store_rs.ListResult
::: object_store_rs.ListStream
::: object_store_py.list
::: object_store_py.list_with_delimiter
::: object_store_py.list_with_delimiter_async
::: object_store_py.ObjectMeta
::: object_store_py.ListResult
::: object_store_py.ListStream
6 changes: 3 additions & 3 deletions docs/api/put.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Put

::: object_store_rs.put
::: object_store_rs.put_async
::: object_store_rs.PutResult
::: object_store_py.put
::: object_store_py.put_async
::: object_store_py.PutResult
4 changes: 2 additions & 2 deletions docs/api/rename.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Rename

::: object_store_rs.rename
::: object_store_rs.rename_async
::: object_store_py.rename
::: object_store_py.rename_async
8 changes: 4 additions & 4 deletions docs/api/sign.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Sign

::: object_store_rs.sign
::: object_store_rs.sign_async
::: object_store_rs.SignCapableStore
::: object_store_rs.HTTP_METHOD
::: object_store_py.sign
::: object_store_py.sign_async
::: object_store_py.SignCapableStore
::: object_store_py.HTTP_METHOD
4 changes: 2 additions & 2 deletions docs/api/store/aws.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# AWS S3

::: object_store_rs.store.S3Store
::: object_store_rs.store.S3ConfigKey
::: object_store_py.store.S3Store
::: object_store_py.store.S3ConfigKey
4 changes: 2 additions & 2 deletions docs/api/store/azure.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Microsoft Azure

::: object_store_rs.store.AzureStore
::: object_store_rs.store.AzureConfigKey
::: object_store_py.store.AzureStore
::: object_store_py.store.AzureConfigKey
6 changes: 3 additions & 3 deletions docs/api/store/config.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Configuration

::: object_store_rs.store.ClientConfigKey
::: object_store_rs.store.BackoffConfig
::: object_store_rs.store.RetryConfig
::: object_store_py.store.ClientConfigKey
::: object_store_py.store.BackoffConfig
::: object_store_py.store.RetryConfig
4 changes: 2 additions & 2 deletions docs/api/store/gcs.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Google Cloud Storage

::: object_store_rs.store.GCSStore
::: object_store_rs.store.GCSConfigKey
::: object_store_py.store.GCSStore
::: object_store_py.store.GCSConfigKey
2 changes: 1 addition & 1 deletion docs/api/store/http.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# HTTP

::: object_store_rs.store.HTTPStore
::: object_store_py.store.HTTPStore
2 changes: 1 addition & 1 deletion docs/api/store/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# ObjectStore

::: object_store_rs.store.ObjectStore
::: object_store_py.store.ObjectStore
2 changes: 1 addition & 1 deletion docs/api/store/local.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Local

::: object_store_rs.store.LocalStore
::: object_store_py.store.LocalStore
2 changes: 1 addition & 1 deletion docs/api/store/memory.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Memory

::: object_store_rs.store.MemoryStore
::: object_store_py.store.MemoryStore
Loading

0 comments on commit 1d403ea

Please sign in to comment.