Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Cloud Storage Utility

codecov PyPI pyversions PRs Welcome Open Source? Yes!

A Python based cloud utility to help you transfer files to and from multiple cloud providers under one CLI/API.

Supported Cloud Platforms

Platform Implemented
IBM Cloud ✅
Azure ❌ Coming Soon!
AWS ❌ Coming Soon!

Installation

pip install cloud-storage-utility

Usage

Configuration

To configure this application, you have to set a few environment variables.

# Currently we only support 'ibm'
CSUTIL_CLOUD_PLATFORM=

# You only need to set these if you intend to use ibm
CSUTIL_IBM_API_KEY=
CSUTIL_IBM_AUTH_ENDPOINT=
CSUTIL_IBM_COS_ENDPOINT=

# If `CSUTIL_IBM_API_KEY` is undefined, we will attempt to use `IBMCLOUD_API_KEY` instead.

CLI Commands

You can use csutil --help to see an exhaustive list of options and commands

csutil delete <bucket name> <filename>
csutil list-remote <bucket name>
csutil pull <bucket name> <destination directory>  <cloud-files>
csutil push <bucket name> <local-files>

Here are some examples

csutil delete example-bucket *.txt
csutil delete example-bucket *.txt *.md example.csv

csutil list-remote example-bucket

csutil pull example-bucket ./dat *
csutil pull example-bucket ./dat tmp.txt tmp2.txt *.md

csutil push example-bucket ./dat/*
csutil push example-bucket/test_directory ./dat/tmp.txt ./dat/tmp2.txt

Python API

Example usage

import asyncio
from cloud_storage_utility.file_broker import FileBroker

config = IbmConfiguration(
    auth_endpoint="http://ibm-endpoint.com/auth",
    cos_endpoint="https://ibm-endpoint.com/cos",
    api_key="<api-key>"
)

async def main():
    async with FileBroker(config) as file_broker:
        file_broker.download_files(
            bucket_name="test-bucket",
            local_directory="./data",
            file_names=["tmp.txt1", "tmp2.txt"],
        )

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

Check out the API docs for many more detailed examples!

Developing Locally

We use pipenv to manage packages. If you don't already have it installed, make sure to install it via pip install pipenv.

We also use python-dotenv for managing env vars for local development, so you can create a .env file for yourself and set the relevant vars that way.

# You can use any python version, but I recommend 3.9
pipenv --python 3.9

# Gotta use the pre flag because of the code formatter
pipenv install --dev --pre

Now you're all set to start writing code!

https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-object-operations

Metadata

Release files for cloud-storage-utility 0.0.1a12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cloud-storage-utility 0.0.1a12
File Size Uploaded Provenance
cloud-storage-utility-0.0.1a12.tar.gz 156.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cloud-storage-utility 0.0.1a12
File Interpreter ABI Platform
cloud_storage_utility-0.0.1a12-py3-none-any.whl Python 3 none any Details

Total release size: 173.4 kB

Release files / cloud-storage-utility-0.0.1a12.tar.gz

Download URL cloud-storage-utility-0.0.1a12.tar.gz
Size 156.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5cc696e39588cc95ff32671b8b14730c5f6f6b938468f5979e9ee6c5a50ca71a
BLAKE2b-256 checksum
How to use checksums
1d1ad595d4841f2640e3aed6624297d9a101f0793146d78e36c7b624b6813f99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

Release files / cloud_storage_utility-0.0.1a12-py3-none-any.whl

Download URL cloud_storage_utility-0.0.1a12-py3-none-any.whl
Size 17.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
796e2e0275640bab126a067af6819632884932156c3886ae725e8583f9780724
BLAKE2b-256 checksum
How to use checksums
1b6780397c0a32c18e19c9e202ee70f4a972c142997698ec73a2feee6ccafab9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

Security for cloud-storage-utility 0.0.1a12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page