Skip to content

Commit

Permalink
Rename to obstore (#45)
Browse files Browse the repository at this point in the history
* Rename to obstore

* more renames
  • Loading branch information
kylebarron authored Oct 24, 2024
1 parent 70a0de9 commit 5f50fda
Show file tree
Hide file tree
Showing 58 changed files with 133 additions and 130 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-py/Cargo.toml
uv run maturin develop -m obstore/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-py/Cargo.toml
uv run maturin develop -m obstore/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-py/Cargo.toml
# maturin generate-ci github -m obstore/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-py/Cargo.toml
args: --release --out dist --find-interpreter --manifest-path obstore/Cargo.toml
sccache: "true"
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-linux-${{ matrix.platform.target }}-object-store-py
name: wheels-linux-${{ matrix.platform.target }}-obstore
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-py/Cargo.toml
args: --release --out dist --find-interpreter --manifest-path obstore/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-py
name: wheels-musllinux-${{ matrix.platform.target }}-obstore
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-py/Cargo.toml
args: --release --out dist --find-interpreter --manifest-path obstore/Cargo.toml
sccache: "true"
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-windows-${{ matrix.platform.target }}-object-store-py
name: wheels-windows-${{ matrix.platform.target }}-obstore
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-py/Cargo.toml
args: --release --out dist --find-interpreter --manifest-path obstore/Cargo.toml
sccache: "true"
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-macos-${{ matrix.platform.target }}-object-store-py
name: wheels-macos-${{ matrix.platform.target }}-obstore
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-py/Cargo.toml
# args: --out dist --manifest-path obstore/Cargo.toml
# - name: Upload sdist
# uses: actions/upload-artifact@v4
# with:
# name: wheels-sdist-object-store-py
# name: wheels-sdist-obstore
# path: dist

release:
runs-on: ubuntu-latest
name: Release
# environment:
# name: release
# url: https://pypi.org/p/object-store-py
# url: https://pypi.org/p/obstore
# 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-py
pattern: wheels-*-obstore
merge-multiple: true
path: dist
- uses: actions/setup-python@v4
Expand Down
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-py", "pyo3-object_store"]
members = ["obstore", "pyo3-object_store"]
resolver = "2"

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

[![PyPI][pypi_badge]][pypi_link]
<!-- [![Conda Version][conda_version_badge]][conda_version] -->

[pypi_badge]: https://badge.fury.io/py/object-store-py.svg
[pypi_link]: https://pypi.org/project/object-store-py/
<!-- [conda_version_badge]: https://img.shields.io/conda/vn/conda-forge/object-store-py.svg
[conda_version]: https://anaconda.org/conda-forge/object-store-py -->
[pypi_badge]: https://badge.fury.io/py/obstore.svg
[pypi_link]: https://pypi.org/project/obstore/
<!-- [conda_version_badge]: https://img.shields.io/conda/vn/conda-forge/obstore.svg
[conda_version]: https://anaconda.org/conda-forge/obstore -->

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 @@ -33,31 +33,31 @@ Supported object storage providers include:
## Installation

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

## Documentation

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

## Usage

### Constructing a store

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

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

#### Example

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

session = boto3.Session()
store = S3Store.from_session(session, "bucket-name", config={"AWS_REGION": "us-east-1"})
Expand All @@ -67,33 +67,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-py/latest/api/store/config/) is available via the `client_options` named parameter.
Additional [HTTP client configuration](https://developmentseed.org/obstore/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-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.
- [`copy`](https://developmentseed.org/obstore/latest/api/copy/): Copy an object from one path to another in the same object store.
- [`delete`](https://developmentseed.org/obstore/latest/api/delete/): Delete the object at the specified location.
- [`get`](https://developmentseed.org/obstore/latest/api/get/): Return the bytes that are stored at the specified location.
- [`head`](https://developmentseed.org/obstore/latest/api/head/): Return the metadata for the specified location
- [`list`](https://developmentseed.org/obstore/latest/api/list/): List all the objects with the given prefix.
- [`put`](https://developmentseed.org/obstore/latest/api/put/): Save the provided bytes to the specified location
- [`rename`](https://developmentseed.org/obstore/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-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.
- [`get_range`](https://developmentseed.org/obstore/latest/api/get/#obstore.get_range): Get a specific byte range from a file.
- [`get_ranges`](https://developmentseed.org/obstore/latest/api/get/#obstore.get_ranges): Get multiple byte ranges from a single file.
- [`list_with_delimiter`](https://developmentseed.org/obstore/latest/api/list/#obstore.list_with_delimiter): List objects within a specific directory.
- [`sign`](https://developmentseed.org/obstore/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_py as obs
import obstore as obs

store = obs.store.MemoryStore()

Expand All @@ -117,7 +117,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_py as obs
import obstore 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_py.copy
::: object_store_py.copy_async
::: obstore.copy
::: obstore.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_py.delete
::: object_store_py.delete_async
::: obstore.delete
::: obstore.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_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
::: obstore.get
::: obstore.get_async
::: obstore.get_range
::: obstore.get_range_async
::: obstore.get_ranges
::: obstore.get_ranges_async
::: obstore.GetOptions
::: obstore.GetResult
::: obstore.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_py.head
::: object_store_py.head_async
::: obstore.head
::: obstore.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_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
::: obstore.list
::: obstore.list_with_delimiter
::: obstore.list_with_delimiter_async
::: obstore.ObjectMeta
::: obstore.ListResult
::: obstore.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_py.put
::: object_store_py.put_async
::: object_store_py.PutResult
::: obstore.put
::: obstore.put_async
::: obstore.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_py.rename
::: object_store_py.rename_async
::: obstore.rename
::: obstore.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_py.sign
::: object_store_py.sign_async
::: object_store_py.SignCapableStore
::: object_store_py.HTTP_METHOD
::: obstore.sign
::: obstore.sign_async
::: obstore.SignCapableStore
::: obstore.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_py.store.S3Store
::: object_store_py.store.S3ConfigKey
::: obstore.store.S3Store
::: obstore.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_py.store.AzureStore
::: object_store_py.store.AzureConfigKey
::: obstore.store.AzureStore
::: obstore.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_py.store.ClientConfigKey
::: object_store_py.store.BackoffConfig
::: object_store_py.store.RetryConfig
::: obstore.store.ClientConfigKey
::: obstore.store.BackoffConfig
::: obstore.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_py.store.GCSStore
::: object_store_py.store.GCSConfigKey
::: obstore.store.GCSStore
::: obstore.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_py.store.HTTPStore
::: obstore.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_py.store.ObjectStore
::: obstore.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_py.store.LocalStore
::: obstore.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_py.store.MemoryStore
::: obstore.store.MemoryStore
Loading

0 comments on commit 5f50fda

Please sign in to comment.