diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 3db4b26..3ae0a88 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -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: diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml index 7c48815..d4797d8 100644 --- a/.github/workflows/test-python.yml +++ b/.github/workflows/test-python.yml @@ -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: | diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 64efa46..2b658ec 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -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 @@ -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: @@ -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: @@ -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: @@ -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: @@ -147,11 +147,11 @@ 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: @@ -159,7 +159,7 @@ jobs: 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 @@ -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 diff --git a/Cargo.toml b/Cargo.toml index 25cfc56..ad737fa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,12 +1,12 @@ [workspace] -members = ["object-store-py", "pyo3-object_store"] +members = ["obstore", "pyo3-object_store"] resolver = "2" [workspace.package] authors = ["Kyle Barron "] 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 = [] diff --git a/README.md b/README.md index 2719a72..6d401c3 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -# object-store-py +# obstore [![PyPI][pypi_badge]][pypi_link] -[pypi_badge]: https://badge.fury.io/py/object-store-py.svg -[pypi_link]: https://pypi.org/project/object-store-py/ - +[pypi_badge]: https://badge.fury.io/py/obstore.svg +[pypi_link]: https://pypi.org/project/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. @@ -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"}) @@ -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() @@ -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() diff --git a/docs/api/copy.md b/docs/api/copy.md index 73873c2..56014d9 100644 --- a/docs/api/copy.md +++ b/docs/api/copy.md @@ -1,4 +1,4 @@ # Copy -::: object_store_py.copy -::: object_store_py.copy_async +::: obstore.copy +::: obstore.copy_async diff --git a/docs/api/delete.md b/docs/api/delete.md index 209fbf2..9a491f6 100644 --- a/docs/api/delete.md +++ b/docs/api/delete.md @@ -1,2 +1,2 @@ -::: object_store_py.delete -::: object_store_py.delete_async +::: obstore.delete +::: obstore.delete_async diff --git a/docs/api/get.md b/docs/api/get.md index fa3d071..ccf6d0f 100644 --- a/docs/api/get.md +++ b/docs/api/get.md @@ -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 diff --git a/docs/api/head.md b/docs/api/head.md index 344ceff..63b1bff 100644 --- a/docs/api/head.md +++ b/docs/api/head.md @@ -1,4 +1,4 @@ # Head -::: object_store_py.head -::: object_store_py.head_async +::: obstore.head +::: obstore.head_async diff --git a/docs/api/list.md b/docs/api/list.md index 617aa41..04797a6 100644 --- a/docs/api/list.md +++ b/docs/api/list.md @@ -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 diff --git a/docs/api/put.md b/docs/api/put.md index 38edacd..5279775 100644 --- a/docs/api/put.md +++ b/docs/api/put.md @@ -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 diff --git a/docs/api/rename.md b/docs/api/rename.md index 0fa3df5..9b97c6f 100644 --- a/docs/api/rename.md +++ b/docs/api/rename.md @@ -1,4 +1,4 @@ # Rename -::: object_store_py.rename -::: object_store_py.rename_async +::: obstore.rename +::: obstore.rename_async diff --git a/docs/api/sign.md b/docs/api/sign.md index c2a7ab9..690e2e4 100644 --- a/docs/api/sign.md +++ b/docs/api/sign.md @@ -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 diff --git a/docs/api/store/aws.md b/docs/api/store/aws.md index 6179bc5..e129c41 100644 --- a/docs/api/store/aws.md +++ b/docs/api/store/aws.md @@ -1,4 +1,4 @@ # AWS S3 -::: object_store_py.store.S3Store -::: object_store_py.store.S3ConfigKey +::: obstore.store.S3Store +::: obstore.store.S3ConfigKey diff --git a/docs/api/store/azure.md b/docs/api/store/azure.md index 124080d..546d035 100644 --- a/docs/api/store/azure.md +++ b/docs/api/store/azure.md @@ -1,4 +1,4 @@ # Microsoft Azure -::: object_store_py.store.AzureStore -::: object_store_py.store.AzureConfigKey +::: obstore.store.AzureStore +::: obstore.store.AzureConfigKey diff --git a/docs/api/store/config.md b/docs/api/store/config.md index 7a03407..2a4ef8e 100644 --- a/docs/api/store/config.md +++ b/docs/api/store/config.md @@ -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 diff --git a/docs/api/store/gcs.md b/docs/api/store/gcs.md index f5c81cf..a89c3cd 100644 --- a/docs/api/store/gcs.md +++ b/docs/api/store/gcs.md @@ -1,4 +1,4 @@ # Google Cloud Storage -::: object_store_py.store.GCSStore -::: object_store_py.store.GCSConfigKey +::: obstore.store.GCSStore +::: obstore.store.GCSConfigKey diff --git a/docs/api/store/http.md b/docs/api/store/http.md index e38820c..53e1001 100644 --- a/docs/api/store/http.md +++ b/docs/api/store/http.md @@ -1,3 +1,3 @@ # HTTP -::: object_store_py.store.HTTPStore +::: obstore.store.HTTPStore diff --git a/docs/api/store/index.md b/docs/api/store/index.md index 73c089b..ba12e10 100644 --- a/docs/api/store/index.md +++ b/docs/api/store/index.md @@ -1,3 +1,3 @@ # ObjectStore -::: object_store_py.store.ObjectStore +::: obstore.store.ObjectStore diff --git a/docs/api/store/local.md b/docs/api/store/local.md index 6debc85..ceb0cda 100644 --- a/docs/api/store/local.md +++ b/docs/api/store/local.md @@ -1,3 +1,3 @@ # Local -::: object_store_py.store.LocalStore +::: obstore.store.LocalStore diff --git a/docs/api/store/memory.md b/docs/api/store/memory.md index 1d74524..ced4fd8 100644 --- a/docs/api/store/memory.md +++ b/docs/api/store/memory.md @@ -1,3 +1,3 @@ # Memory -::: object_store_py.store.MemoryStore +::: obstore.store.MemoryStore diff --git a/mkdocs.yml b/mkdocs.yml index 5c22941..d673707 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,11 +1,11 @@ -site_name: object-store-py -repo_name: developmentseed/object-store-py -repo_url: https://github.com/developmentseed/object-store-py +site_name: obstore +repo_name: developmentseed/obstore +repo_url: https://github.com/developmentseed/obstore site_description: A Python interface and pyo3 integration to the Rust object-store crate. site_author: Development Seed # Note: trailing slash recommended with mike: # https://squidfunk.github.io/mkdocs-material/setup/setting-up-versioning/#publishing-a-new-version -site_url: https://developmentseed.org/object-store-py/ +site_url: https://developmentseed.org/obstore/ docs_dir: docs extra: @@ -41,7 +41,7 @@ nav: - api/sign.md watch: - - object-store-py/python + - obstore/python - docs theme: diff --git a/object-store-py/python/object_store_py/__init__.py b/object-store-py/python/object_store_py/__init__.py deleted file mode 100644 index 0f4d94d..0000000 --- a/object-store-py/python/object_store_py/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -from . import store -from ._object_store_py import * -from ._object_store_py import ___version - -__version__: str = ___version() diff --git a/object-store-py/Cargo.toml b/obstore/Cargo.toml similarity index 98% rename from object-store-py/Cargo.toml rename to obstore/Cargo.toml index 5e05d0e..f73134b 100644 --- a/object-store-py/Cargo.toml +++ b/obstore/Cargo.toml @@ -14,7 +14,7 @@ rust-version = { workspace = true } # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [lib] -name = "_object_store_py" +name = "_obstore" crate-type = ["cdylib"] [dependencies] diff --git a/object-store-py/README.md b/obstore/README.md similarity index 100% rename from object-store-py/README.md rename to obstore/README.md diff --git a/object-store-py/pyproject.toml b/obstore/pyproject.toml similarity index 90% rename from object-store-py/pyproject.toml rename to obstore/pyproject.toml index 760c196..3fc0f32 100644 --- a/object-store-py/pyproject.toml +++ b/obstore/pyproject.toml @@ -15,6 +15,6 @@ dynamic = ["version"] [tool.maturin] features = ["pyo3/extension-module"] -module-name = "object_store_py._object_store_py" +module-name = "obstore._obstore" python-source = "python" strip = true diff --git a/obstore/python/obstore/__init__.py b/obstore/python/obstore/__init__.py new file mode 100644 index 0000000..736e99f --- /dev/null +++ b/obstore/python/obstore/__init__.py @@ -0,0 +1,5 @@ +from . import store +from ._obstore import * +from ._obstore import ___version + +__version__: str = ___version() diff --git a/object-store-py/python/object_store_py/_copy.pyi b/obstore/python/obstore/_copy.pyi similarity index 93% rename from object-store-py/python/object_store_py/_copy.pyi rename to obstore/python/obstore/_copy.pyi index a85013c..b2517b3 100644 --- a/object-store-py/python/object_store_py/_copy.pyi +++ b/obstore/python/obstore/_copy.pyi @@ -22,5 +22,5 @@ async def copy_async( ) -> None: """Call `copy` asynchronously. - Refer to the documentation for [copy][object_store_py.copy]. + Refer to the documentation for [copy][obstore.copy]. """ diff --git a/object-store-py/python/object_store_py/_delete.pyi b/obstore/python/obstore/_delete.pyi similarity index 92% rename from object-store-py/python/object_store_py/_delete.pyi rename to obstore/python/obstore/_delete.pyi index 1538015..0932799 100644 --- a/object-store-py/python/object_store_py/_delete.pyi +++ b/obstore/python/obstore/_delete.pyi @@ -21,5 +21,5 @@ def delete(store: ObjectStore, paths: str | Sequence[str]) -> None: async def delete_async(store: ObjectStore, paths: str | Sequence[str]) -> None: """Call `delete` asynchronously. - Refer to the documentation for [delete][object_store_py.delete]. + Refer to the documentation for [delete][obstore.delete]. """ diff --git a/object-store-py/python/object_store_py/_get.pyi b/obstore/python/obstore/_get.pyi similarity index 97% rename from object-store-py/python/object_store_py/_get.pyi rename to obstore/python/obstore/_get.pyi index 014ef9e..fad755e 100644 --- a/object-store-py/python/object_store_py/_get.pyi +++ b/obstore/python/obstore/_get.pyi @@ -228,7 +228,7 @@ async def get_async( ) -> GetResult: """Call `get` asynchronously. - Refer to the documentation for [get][object_store_py.get]. + Refer to the documentation for [get][obstore.get]. """ def get_range(store: ObjectStore, path: str, offset: int, length: int) -> Buffer: @@ -256,7 +256,7 @@ async def get_range_async( ) -> Buffer: """Call `get_range` asynchronously. - Refer to the documentation for [get_range][object_store_py.get_range]. + Refer to the documentation for [get_range][obstore.get_range]. """ def get_ranges( @@ -287,5 +287,5 @@ async def get_ranges_async( ) -> List[Buffer]: """Call `get_ranges` asynchronously. - Refer to the documentation for [get_ranges][object_store_py.get_ranges]. + Refer to the documentation for [get_ranges][obstore.get_ranges]. """ diff --git a/object-store-py/python/object_store_py/_head.pyi b/obstore/python/obstore/_head.pyi similarity index 87% rename from object-store-py/python/object_store_py/_head.pyi rename to obstore/python/obstore/_head.pyi index 1463aa3..7e01f5e 100644 --- a/object-store-py/python/object_store_py/_head.pyi +++ b/obstore/python/obstore/_head.pyi @@ -15,5 +15,5 @@ def head(store: ObjectStore, path: str) -> ObjectMeta: async def head_async(store: ObjectStore, path: str) -> ObjectMeta: """Call `head` asynchronously. - Refer to the documentation for [head][object_store_py.head]. + Refer to the documentation for [head][obstore.head]. """ diff --git a/object-store-py/python/object_store_py/_list.pyi b/obstore/python/obstore/_list.pyi similarity index 92% rename from object-store-py/python/object_store_py/_list.pyi rename to obstore/python/obstore/_list.pyi index 8f51fbc..b8e2f2d 100644 --- a/object-store-py/python/object_store_py/_list.pyi +++ b/obstore/python/obstore/_list.pyi @@ -43,7 +43,7 @@ ChunkType = TypeVar("ChunkType", List[ObjectMeta], RecordBatch) class ListStream(Generic[ChunkType]): """ - A stream of [ObjectMeta][object_store_py.ObjectMeta] that can be polled in a sync or + A stream of [ObjectMeta][obstore.ObjectMeta] that can be polled in a sync or async fashion. """ def __aiter__(self) -> Self: @@ -110,8 +110,8 @@ def list( Synchronously iterate through list results: ```py - import object_store_py as obs - from object_store_py.store import MemoryStore + import obstore as obs + from obstore.store import MemoryStore store = MemoryStore() for i in range(100): @@ -157,13 +157,13 @@ def list( ``` !!! note - The order of returned [`ObjectMeta`][object_store_py.ObjectMeta] is not + The order of returned [`ObjectMeta`][obstore.ObjectMeta] is not guaranteed !!! note There is no async version of this method, because `list` is not async under the hood, rather it only instantiates a stream, which can be polled in synchronous - or asynchronous fashion. See [`ListStream`][object_store_py.ListStream]. + or asynchronous fashion. See [`ListStream`][obstore.ListStream]. Args: store: The ObjectStore instance to use. @@ -174,8 +174,8 @@ def list( chunk_size: The number of items to collect per chunk in the returned (async) iterator. All chunks except for the last one will have this many items. This is ignored in the - [`collect`][object_store_py.ListStream.collect] and - [`collect_async`][object_store_py.ListStream.collect_async] methods of + [`collect`][obstore.ListStream.collect] and + [`collect_async`][obstore.ListStream.collect_async] methods of `ListStream`. return_arrow: If `True`, return each batch of list items as an Arrow `RecordBatch`, not as a list of Python `dict`s. Arrow removes serialization @@ -210,5 +210,5 @@ async def list_with_delimiter_async( """Call `list_with_delimiter` asynchronously. Refer to the documentation for - [list_with_delimiter][object_store_py.list_with_delimiter]. + [list_with_delimiter][obstore.list_with_delimiter]. """ diff --git a/object-store-py/python/object_store_py/_object_store_py.pyi b/obstore/python/obstore/_obstore.pyi similarity index 100% rename from object-store-py/python/object_store_py/_object_store_py.pyi rename to obstore/python/obstore/_obstore.pyi diff --git a/object-store-py/python/object_store_py/_put.pyi b/obstore/python/obstore/_put.pyi similarity index 96% rename from object-store-py/python/object_store_py/_put.pyi rename to obstore/python/obstore/_put.pyi index 3c9b704..8e1d684 100644 --- a/object-store-py/python/object_store_py/_put.pyi +++ b/obstore/python/obstore/_put.pyi @@ -56,5 +56,5 @@ async def put_async( ) -> PutResult: """Call `put` asynchronously. - Refer to the documentation for [put][object_store_py.put]. + Refer to the documentation for [put][obstore.put]. """ diff --git a/object-store-py/python/object_store_py/_rename.pyi b/obstore/python/obstore/_rename.pyi similarity index 92% rename from object-store-py/python/object_store_py/_rename.pyi rename to obstore/python/obstore/_rename.pyi index 2cdd532..9bcd6a9 100644 --- a/object-store-py/python/object_store_py/_rename.pyi +++ b/obstore/python/obstore/_rename.pyi @@ -23,5 +23,5 @@ async def rename_async( ) -> None: """Call `rename` asynchronously. - Refer to the documentation for [rename][object_store_py.rename]. + Refer to the documentation for [rename][obstore.rename]. """ diff --git a/object-store-py/python/object_store_py/_sign.pyi b/obstore/python/obstore/_sign.pyi similarity index 96% rename from object-store-py/python/object_store_py/_sign.pyi rename to obstore/python/obstore/_sign.pyi index cce8e22..e03636c 100644 --- a/object-store-py/python/object_store_py/_sign.pyi +++ b/obstore/python/obstore/_sign.pyi @@ -68,5 +68,5 @@ async def sign_async( ) -> str | List[str]: """Call `sign` asynchronously. - Refer to the documentation for [sign][object_store_py.sign]. + Refer to the documentation for [sign][obstore.sign]. """ diff --git a/object-store-py/python/object_store_py/store/__init__.pyi b/obstore/python/obstore/store/__init__.pyi similarity index 100% rename from object-store-py/python/object_store_py/store/__init__.pyi rename to obstore/python/obstore/store/__init__.pyi diff --git a/object-store-py/python/object_store_py/store/_aws.pyi b/obstore/python/obstore/store/_aws.pyi similarity index 100% rename from object-store-py/python/object_store_py/store/_aws.pyi rename to obstore/python/obstore/store/_aws.pyi diff --git a/object-store-py/python/object_store_py/store/_azure.pyi b/obstore/python/obstore/store/_azure.pyi similarity index 100% rename from object-store-py/python/object_store_py/store/_azure.pyi rename to obstore/python/obstore/store/_azure.pyi diff --git a/object-store-py/python/object_store_py/store/_client.pyi b/obstore/python/obstore/store/_client.pyi similarity index 100% rename from object-store-py/python/object_store_py/store/_client.pyi rename to obstore/python/obstore/store/_client.pyi diff --git a/object-store-py/python/object_store_py/store/_gcs.pyi b/obstore/python/obstore/store/_gcs.pyi similarity index 100% rename from object-store-py/python/object_store_py/store/_gcs.pyi rename to obstore/python/obstore/store/_gcs.pyi diff --git a/object-store-py/python/object_store_py/store/_http.pyi b/obstore/python/obstore/store/_http.pyi similarity index 100% rename from object-store-py/python/object_store_py/store/_http.pyi rename to obstore/python/obstore/store/_http.pyi diff --git a/object-store-py/python/object_store_py/store/_retry.pyi b/obstore/python/obstore/store/_retry.pyi similarity index 94% rename from object-store-py/python/object_store_py/store/_retry.pyi rename to obstore/python/obstore/store/_retry.pyi index b4b2194..938f156 100644 --- a/object-store-py/python/object_store_py/store/_retry.pyi +++ b/obstore/python/obstore/store/_retry.pyi @@ -31,7 +31,7 @@ class RetryConfig(TypedDict): * Timeouts for [safe] / read-only requests Requests will be retried up to some limit, using exponential - backoff with jitter. See [`BackoffConfig`][object_store_py.store.BackoffConfig] for + backoff with jitter. See [`BackoffConfig`][obstore.store.BackoffConfig] for more information [safe]: https://datatracker.ietf.org/doc/html/rfc7231#section-4.2.1 diff --git a/object-store-py/src/copy.rs b/obstore/src/copy.rs similarity index 100% rename from object-store-py/src/copy.rs rename to obstore/src/copy.rs diff --git a/object-store-py/src/delete.rs b/obstore/src/delete.rs similarity index 100% rename from object-store-py/src/delete.rs rename to obstore/src/delete.rs diff --git a/object-store-py/src/get.rs b/obstore/src/get.rs similarity index 100% rename from object-store-py/src/get.rs rename to obstore/src/get.rs diff --git a/object-store-py/src/head.rs b/obstore/src/head.rs similarity index 100% rename from object-store-py/src/head.rs rename to obstore/src/head.rs diff --git a/object-store-py/src/lib.rs b/obstore/src/lib.rs similarity index 91% rename from object-store-py/src/lib.rs rename to obstore/src/lib.rs index abc3915..fd0c3ba 100644 --- a/object-store-py/src/lib.rs +++ b/obstore/src/lib.rs @@ -20,10 +20,10 @@ fn ___version() -> &'static str { /// A Python module implemented in Rust. #[pymodule] -fn _object_store_py(py: Python, m: &Bound) -> PyResult<()> { +fn _obstore(py: Python, m: &Bound) -> PyResult<()> { m.add_wrapped(wrap_pyfunction!(___version))?; - pyo3_object_store::register_store_module(py, m, "object_store_py")?; + pyo3_object_store::register_store_module(py, m, "obstore")?; m.add_wrapped(wrap_pyfunction!(copy::copy_async))?; m.add_wrapped(wrap_pyfunction!(copy::copy))?; diff --git a/object-store-py/src/list.rs b/obstore/src/list.rs similarity index 100% rename from object-store-py/src/list.rs rename to obstore/src/list.rs diff --git a/object-store-py/src/path.rs b/obstore/src/path.rs similarity index 100% rename from object-store-py/src/path.rs rename to obstore/src/path.rs diff --git a/object-store-py/src/put.rs b/obstore/src/put.rs similarity index 100% rename from object-store-py/src/put.rs rename to obstore/src/put.rs diff --git a/object-store-py/src/rename.rs b/obstore/src/rename.rs similarity index 100% rename from object-store-py/src/rename.rs rename to obstore/src/rename.rs diff --git a/object-store-py/src/runtime.rs b/obstore/src/runtime.rs similarity index 100% rename from object-store-py/src/runtime.rs rename to obstore/src/runtime.rs diff --git a/object-store-py/src/signer.rs b/obstore/src/signer.rs similarity index 100% rename from object-store-py/src/signer.rs rename to obstore/src/signer.rs diff --git a/tests/test_delete.py b/tests/test_delete.py index 0827ed3..fd3da65 100644 --- a/tests/test_delete.py +++ b/tests/test_delete.py @@ -1,8 +1,9 @@ from tempfile import TemporaryDirectory -import object_store_py as obs import pytest -from object_store_py.store import LocalStore, MemoryStore + +import obstore as obs +from obstore.store import LocalStore, MemoryStore def test_delete_one(): diff --git a/tests/test_get.py b/tests/test_get.py index bd228a0..42965e4 100644 --- a/tests/test_get.py +++ b/tests/test_get.py @@ -1,6 +1,7 @@ -import object_store_py as obs import pytest -from object_store_py.store import MemoryStore + +import obstore as obs +from obstore.store import MemoryStore def test_stream_sync(): diff --git a/tests/test_list.py b/tests/test_list.py index 37098c1..8e6b1df 100644 --- a/tests/test_list.py +++ b/tests/test_list.py @@ -1,7 +1,8 @@ -import object_store_py as obs import pytest from arro3.core import RecordBatch -from object_store_py.store import MemoryStore + +import obstore as obs +from obstore.store import MemoryStore def test_list(): diff --git a/tests/test_put.py b/tests/test_put.py index 9d237c3..ec23d5f 100644 --- a/tests/test_put.py +++ b/tests/test_put.py @@ -1,5 +1,5 @@ -import object_store_py as obs -from object_store_py.store import MemoryStore +import obstore as obs +from obstore.store import MemoryStore def test_put_non_multipart():