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).
  • Multi-Language: Native Rust library with Python 3.14 bindings.
  • 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://container/path (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
    
  • List objects:

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

    osc rm s3://my-bucket/temp_file.tmp
    

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.to_vec()).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?;

    Ok(())
}

Python 3.14 Usage

Installation

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

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("s3://my-bucket/python_test.txt", b"Hello from Python 3.14!")

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

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

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

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

Developer Instructions

Prerequisites

  • Rust 1.85+ (or latest stable)
  • Python 3.14+
  • 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.3.tar.gz (8.0 MB 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.3-cp314-cp314-manylinux_2_39_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.39+ x86-64

object_storage_client-0.0.3-cp314-cp314-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

object_storage_client-0.0.3-cp313-cp313-manylinux_2_39_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.39+ x86-64

object_storage_client-0.0.3-cp313-cp313-macosx_11_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for object_storage_client-0.0.3.tar.gz
Algorithm Hash digest
SHA256 5ddcb8e5de31563d9f023954c175bd062829883bde1ecd3bffdbee58ad2ae066
MD5 8eaad4daa4143b22cd8e34403f6320a9
BLAKE2b-256 7adf395c300da3e6996bde7d793bc18f4e1855b14320f2f86694b4eea19baf07

See more details on using hashes here.

File details

Details for the file object_storage_client-0.0.3-cp314-cp314-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for object_storage_client-0.0.3-cp314-cp314-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 d9986cb62aa611bece30a5e567e9524d7f785ff59fd48d08ea3c8c7b48daf0c4
MD5 920099b6b58e1f70ab088d1c064226be
BLAKE2b-256 f2477eaa08a688c2a5821ea933fdd6f33259f310f89d4428ac24687946fb026b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for object_storage_client-0.0.3-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 200ad6d42505a291e6123601c56e4f62a09553676e661b040953a6183b940a90
MD5 63b868b22f21ed43ff10d123b8a1ee16
BLAKE2b-256 2f4314c4f1166a09c3d4436f158abf4751d0d0497ab16e4f26a810c8057bae8c

See more details on using hashes here.

File details

Details for the file object_storage_client-0.0.3-cp313-cp313-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for object_storage_client-0.0.3-cp313-cp313-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 4111032050916c58c351e5c7daf17d919d98cf4da9252133d82806777d0c1694
MD5 f3d4d22647619b1824113744c07ae3e2
BLAKE2b-256 a31e137642888d84610d81822d9ccf6d491bc45814ed54a892ac746b5e0a0cae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for object_storage_client-0.0.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 41bc34337433536399455551a82d4d96ba3688efcec55cfb010c48ae4ee37285
MD5 fbeb906b6aaa42c0c52da5ce9ed4d7c6
BLAKE2b-256 d3eaa11189a7ada5df56b61866b06891875eca75a16d2b178570c40baa06d430

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