Skip to main content

Unified object storage client API

Project description

Object Storage Client

A unified object storage client for Rust and Python, supporting S3, GCS, Azure Blob Storage, HTTP/HTTPS, and Local Filesystem. It provides a simple, URL-based API for object operations, including cross-provider copy and move.

Features

  • Unified API: Single interface for various storage backends.
  • Cross-Provider: Copy or move objects between different storage providers (e.g., S3 to Local FS).
  • Pre-signed URLs: Generate time-limited, credential-free URLs for S3, GCS and Azure.
  • Multi-Language: Native Rust library with Python 3.13+ bindings.
  • Streaming: Async streaming support for both Rust and Python.
  • CLI: osc command-line tool for quick operations.

Supported Schemes

  • s3://bucket/path (AWS S3)
  • gs://bucket/path or gcs://bucket/path (Google Cloud Storage)
  • az://, wasb://, wasbs://, abfs://, or abfss:// (Azure Blob Storage)
  • http://host/path or https://host/path (HTTP/HTTPS)
  • file:///absolute/path or local_path (Local Filesystem)

CLI Usage (osc)

The osc tool allows you to interact with object storage directly from your terminal.

Installation

If you have the source code, you can install it using Cargo:

cargo install --path .

Examples

  • Upload a local file:

    osc put my_file.txt s3://my-bucket/remote_file.txt
    
  • Download an object:

    osc get gs://my-bucket/data.json ./local_data.json
    
  • Copy between providers:

    osc cp s3://source-bucket/image.png az://dest-container/image.png
    
  • Move an object:

    osc mv s3://my-bucket/old_name.txt s3://my-bucket/new_name.txt
    
  • List objects:

    osc ls s3://my-bucket/logs/
    
  • Delete an object:

    osc rm s3://my-bucket/temp_file.tmp
    
  • Stream an object:

    osc get-stream gs://my-bucket/large_file.bin
    
  • Generate a pre-signed URL (S3, GCS, Azure):

    # Pre-signed download URL, valid for the default 1 hour
    osc sign s3://my-bucket/report.pdf
    
    # Pre-signed upload URL (PUT), valid for 15 minutes
    osc sign --method PUT --expires-in 900 s3://my-bucket/upload.bin
    

Rust Usage

Installation

Add object-storage-client to your Cargo.toml:

[dependencies]
object-storage-client = { git = "https://github.com/bixority/object-storage-client" }
tokio = { version = "1.0", features = ["full"] }

Example

use object_storage_client::ObjectStorageClient;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = ObjectStorageClient::new();

    // Upload data
    let data = b"Hello from Rust!";
    client.put("s3://my-bucket/hello.txt", &data).await?;

    // Download data
    let retrieved = client.get("s3://my-bucket/hello.txt").await?;
    println!("Retrieved: {:?}", String::from_utf8(retrieved.to_vec())?);

    // Cross-provider copy (S3 to Local)
    client.copy("s3://my-bucket/hello.txt", "file:///tmp/hello_local.txt").await?;

    // Pre-signed URL: time-limited, credential-free access (S3/GCS/Azure)
    use object_storage_client::SignMethod;
    use std::time::Duration;

    // Pre-signed download (GET) link, valid for one hour
    let download_url = client
        .get_pre_signed_url("s3://my-bucket/hello.txt", SignMethod::Get, Duration::from_secs(3600))
        .await?;
    println!("Share this download link: {download_url}");

    // Pre-signed upload (PUT) link, valid for 15 minutes
    let upload_url = client
        .get_pre_signed_url("s3://my-bucket/upload.bin", SignMethod::Put, Duration::from_secs(900))
        .await?;
    println!("Upload directly to: {upload_url}");

    Ok(())
}

Python 3.13+ Usage

Installation

You can install the package using pip. Note that it requires Python 3.13+.

pip install git+https://github.com/bixority/object-storage-client

Or if you are developing locally, you can use maturin:

maturin develop

Example

import asyncio
from object_storage_client import ObjectStorageClient

async def main():
    client = ObjectStorageClient()

    # Upload data
    await client.put_object("s3://my-bucket/python_test.txt", b"Hello from Python!")

    # Download data
    data = await client.get_object("s3://my-bucket/python_test.txt")
    print(f"Retrieved: {data.decode()}")

    # List objects
    items = await client.list_objects("s3://my-bucket/")
    print(f"Bucket items: {items}")

    # Stream data
    stream = await client.get_object_stream("s3://my-bucket/python_test.txt")
    async for chunk in stream:
        print(f"Chunk size: {len(chunk)}")

    # Cross-provider move (GCS to S3)
    await client.move_object("gs://my-gcs-bucket/data.csv", "s3://my-s3-bucket/data.csv")

    # Pre-signed URL (S3/GCS/Azure): hand out credential-free, time-limited access
    download_url = await client.get_pre_signed_url("s3://my-bucket/python_test.txt")
    upload_url = await client.get_pre_signed_url(
        "s3://my-bucket/upload.bin", method="PUT", expires_in_secs=900
    )
    print(f"Download: {download_url}\nUpload: {upload_url}")

if __name__ == "__main__":
    asyncio.run(main())

Developer Instructions

Prerequisites

  • Rust 1.85+ (or latest stable)
  • Python 3.13+
  • maturin (for Python bindings)

Building

  • Rust: cargo build --release
  • Python: maturin build --release
  • CLI: cargo build --bin osc

Testing

cargo 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_storage_client-0.0.31.tar.gz (46.9 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

object_storage_client-0.0.31-cp314-cp314-win_amd64.whl (2.3 MB view details)

Uploaded CPython 3.14Windows x86-64

object_storage_client-0.0.31-cp314-cp314-manylinux_2_28_aarch64.whl (2.4 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ ARM64

object_storage_client-0.0.31-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

object_storage_client-0.0.31-cp314-cp314-macosx_11_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

object_storage_client-0.0.31-cp313-cp313-win_amd64.whl (2.3 MB view details)

Uploaded CPython 3.13Windows x86-64

object_storage_client-0.0.31-cp313-cp313-manylinux_2_28_aarch64.whl (2.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

object_storage_client-0.0.31-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

object_storage_client-0.0.31-cp313-cp313-macosx_11_0_arm64.whl (2.1 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

File details

Details for the file object_storage_client-0.0.31.tar.gz.

File metadata

  • Download URL: object_storage_client-0.0.31.tar.gz
  • Upload date:
  • Size: 46.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for object_storage_client-0.0.31.tar.gz
Algorithm Hash digest
SHA256 43da7644984450c0a29bcd3f80484fbba7bafec5b1d87e28f2352d7c305de24c
MD5 0888141be86c874b15e1ca2e0dbf97d0
BLAKE2b-256 13e83ea39e457c397d0dc5a21b940ac31184c5ae89fb3fd1b895c3d9bf768ef7

See more details on using hashes here.

File details

Details for the file object_storage_client-0.0.31-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: object_storage_client-0.0.31-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 2.3 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for object_storage_client-0.0.31-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 5472ca49679ff4e96a4bede8cbca0b0c3bf9e7ad807105a6052abfd63d386956
MD5 b76dc7c7dcce1b7ad6063b50f3632154
BLAKE2b-256 6114dcdcee8ca514bb35f6ff58cdca99c19fceb5265e7c105b532161cac23bb6

See more details on using hashes here.

File details

Details for the file object_storage_client-0.0.31-cp314-cp314-manylinux_2_28_aarch64.whl.

File metadata

  • Download URL: object_storage_client-0.0.31-cp314-cp314-manylinux_2_28_aarch64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.14, manylinux: glibc 2.28+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for object_storage_client-0.0.31-cp314-cp314-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 942edf00a6588a77fd4c41cb5ab7e7f0a173a0a72c2e258f3ec5f9a22125b1bd
MD5 45644a55d8e9a2314379562c96aa21d7
BLAKE2b-256 afbc2d676fd569d0b34a312119cea52ba7d87689a2d11748e0e1f1ca8a39edc6

See more details on using hashes here.

File details

Details for the file object_storage_client-0.0.31-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: object_storage_client-0.0.31-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: CPython 3.14, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for object_storage_client-0.0.31-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9750ff38eb067661b03bf53de77ffab899e56233e1bbb93e443bad0f35653629
MD5 0458075df4a4e68bd47450108d0364a5
BLAKE2b-256 7550e4f8be42f6c8b752ba9b39b20aca47cb4c1fc1798551009858ba9c1b8ea5

See more details on using hashes here.

File details

Details for the file object_storage_client-0.0.31-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

  • Download URL: object_storage_client-0.0.31-cp314-cp314-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.14, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for object_storage_client-0.0.31-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 eb407e415015827ddd627492a6bf202ae0fe969b6cbf3ca46bb67094449f936c
MD5 21f1d0c19fce4b8553e5e10237343181
BLAKE2b-256 ec89f4ead6775d5bee50b50b0068d27ca30701e40ea48c9716302aa55abc8d59

See more details on using hashes here.

File details

Details for the file object_storage_client-0.0.31-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: object_storage_client-0.0.31-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 2.3 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for object_storage_client-0.0.31-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 ce352b51d12c8c3b5f968c23d7f676ffbf23cea0db4466798c17a6d021363481
MD5 dcda825b3bf32b2498b7a569200501d3
BLAKE2b-256 d49cc3d242e568d115e3426a0b477ef3ea7ee978febadb0ccd74e533d53fe24a

See more details on using hashes here.

File details

Details for the file object_storage_client-0.0.31-cp313-cp313-manylinux_2_28_aarch64.whl.

File metadata

  • Download URL: object_storage_client-0.0.31-cp313-cp313-manylinux_2_28_aarch64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.13, manylinux: glibc 2.28+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for object_storage_client-0.0.31-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 4fa2c9198cc22fdb94ddbd61a6327dda9bf218b6f76634aad00c85df31982864
MD5 771be82d8563854ca571bd181e24ea82
BLAKE2b-256 ff1c8d4ca36080576599a2a99a7ff81865d98ee3f3f6b8f7a442aa133e712cbc

See more details on using hashes here.

File details

Details for the file object_storage_client-0.0.31-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: object_storage_client-0.0.31-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 2.5 MB
  • Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for object_storage_client-0.0.31-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6513fd94890472d7ab7b5454613aaf750c20b6b417072ed9f70202e6f366812f
MD5 55d2de6a6a3610f7b93e16a57b1d0f2a
BLAKE2b-256 ff73f12c8aedc7a0acd8d1094384887e25a8c531f7ab23d51b9091719f71c034

See more details on using hashes here.

File details

Details for the file object_storage_client-0.0.31-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

  • Download URL: object_storage_client-0.0.31-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.13, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.17 {"installer":{"name":"uv","version":"0.11.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for object_storage_client-0.0.31-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3b424829e585a816315891ef1ab5431a941bfb0e770e827ad5bed984a1286689
MD5 bf4cb10de096916de00ca0d4648002db
BLAKE2b-256 eda44d2a9d9a0310c4322ec22d9d931d6ada0cc46bf3b8ea2db4f3ac1186ea88

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page