Unified object storage helpers for Alibaba OSS and S3-compatible backends
Project description
storage-actions
Unified object storage helpers for Alibaba OSS and S3-compatible backends such as RustFS, MinIO, and generic S3 services.
Features
- One
StorageClientAPI for Alibaba OSS and S3-compatible storage. - Explicit
StorageConfig/StorageProviderconfiguration withfrom_env()andfrom_mapping()helpers. - Browser-facing public URL and presigned URL generation with separate internal and public endpoints.
- Metadata-based ACL compatibility mode for S3-compatible storage that does not support object-level ACL semantics.
- Legacy
aliyun_oss_x.Bucket-style adapter for gradual migrations.
Install
pip install storage-actions
During local development:
uv sync --dev
uv run pytest -v
uv build
For offline delivery, build the wheel ahead of time and install it from the artifact bundle:
uv build
pip install dist/storage_actions-*.whl
Basic Usage
from storage_actions import StorageClient, StorageConfig, StorageProvider
config = StorageConfig(
provider=StorageProvider.RUSTFS,
bucket="private-bucket",
endpoint="http://rustfs:9000",
public_endpoint="https://storage.example.internal",
region="us-east-1",
addressing_style="path",
access_key="access-key",
secret_key="secret-key",
acl_compat_mode="metadata-gateway",
)
storage = StorageClient(config)
storage.put_object("reports/hello.txt", b"hello")
download_url = storage.get("reports/hello.txt", sign=True)
public_url = storage.get("reports/hello.txt", sign=False)
Environment Variables
StorageConfig.from_env() reads these generic variables:
OBJECT_STORAGE_PROVIDER:oss,rustfs,minio, ors3OBJECT_STORAGE_BUCKETOBJECT_STORAGE_ENDPOINTOBJECT_STORAGE_PUBLIC_ENDPOINTOBJECT_STORAGE_CDN_PUBLIC_ENDPOINTOBJECT_STORAGE_REGIONOBJECT_STORAGE_ADDRESSING_STYLE:pathorvirtualOBJECT_STORAGE_ACCESS_KEYOBJECT_STORAGE_SECRET_KEYOBJECT_STORAGE_ACL_COMPAT_MODE
ACL Compatibility
For S3-compatible backends in metadata-gateway mode, put_object_acl("public-read") writes vv-acl=public-read into object metadata. Setting the ACL back to private or default removes the marker.
This mode is designed for deployments where the gateway decides whether anonymous GET/HEAD requests may read an object by checking metadata. Signed URLs and authenticated requests should continue to go directly to the storage backend.
Legacy Adapter
Some older code may still instantiate aliyun_oss_x.Bucket. storage_actions.compat.OssBucketAdapter implements the subset commonly used during migrations:
get_objectget_object_to_fileput_objectput_object_from_fileput_object_aclsign_urlcopy_objectdelete_objecthead_objectobject_existslist_objects_v2get_bucket_info
The adapter also accepts common aliyun_oss_x keyword aliases such as key= and filename=.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file storage_actions-0.1.0.tar.gz.
File metadata
- Download URL: storage_actions-0.1.0.tar.gz
- Upload date:
- Size: 42.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3227d77f4b265a29d408840257bff2d14ce60f515a09faa9db4a09c84a7009b4
|
|
| MD5 |
a61230f5c61157bef6b191e2f9e17986
|
|
| BLAKE2b-256 |
148995be28703fb949daae87fd78aa923571491d26f49d6b4a0d592ffe584d53
|
File details
Details for the file storage_actions-0.1.0-py3-none-any.whl.
File metadata
- Download URL: storage_actions-0.1.0-py3-none-any.whl
- Upload date:
- Size: 15.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63ace092ba44ed14938afc06361125a6f2ed9b913cd576335d3f0c83c9363f73
|
|
| MD5 |
0e97ac375aa39df46ca9e70ec93d82ed
|
|
| BLAKE2b-256 |
6eb5e20c7e43751ad3d04d0d3ad8e047978094ccfccab2c8074b395890849ee7
|