Skip to content

CnS3Api is a python package for managing OVHCloud Object Storage S3

License

Notifications You must be signed in to change notification settings

cnfilms/cn-s3-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python library for OVHCloud Object Storage managment

Lightweight python wrapper around OVHcloud Public Storage S3. Based on AWS boto3, it handles all the hard work including bucket transfers and OVH cold archive actions.

from cn_s3_api.api import CNS3Api

s3_api = CNS3Api(dict(
    aws_access_key_id='xxxxxxxxxxxxxxxxxxxxxxxxx',
    aws_secret_access_key='xxxxxxxxxxxxxxxxxxxxxxxxx',
    endpoint_url='https://s3.rbx.io.cloud.ovh.net/',
    region_name='RBX',
))

s3_api.download('my-bucket', '/path_to_src_file', '/path_to_dst_file')
s3_api.upload('my-bucket', '/path_to_src_file', '/path_to_dst_bucket_file')
s3_api.list('my-bucket')
s3_api.list('my-bucket', '/path_to_dst_bucket_dir')

s3_api.cold_action('archive', 'my-bucket', 'bucket-id')
s3_api.cold_action('status', 'my-bucket', 'bucket-id')
s3_api.cold_action('restore', 'my-bucket', 'bucket-id')

Installation

The python wrapper works with Python 3.6+.

The easiest way to get the latest stable release is to grab it from pypi using pip.

pip install cn_s3_api

Alternatively, you may get latest development version directly from Git.

pip install -e git+https://github.com/cnfilms/cn-s3-api.git

Hacking

This wrapper uses standard Python tools, so you should feel at home with it. Here is a quick outline of what it may look like. A good practice is to run this from a virtualenv.

Get the sources

git clone https://github.com/cnfilms/cn-s3-api.git
cd cn-s3-api
python setup.py develop

Run the tests

Simply run pytest. It will automatically load its configuration from setup.cfg and output full coverage status.

pip install -e .
pytest

Contributing

If you find a bug 🐛, please open a bug report. If you have an idea for an improvement or new feature 🚀, please open a feature request.

License

3-Clause BSD

About

CnS3Api is a python package for managing OVHCloud Object Storage S3

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages