A python library to upload files on cloud. Supported services - AWS S3, DigitalOcean Spaces, LocalStorage.
Project description
# Storedoc 0.1.1
A python module to upload files on cloud. Supported services - [AWS S3](https://aws.amazon.com/s3/), [DigitalOcean Spaces](https://www.digitalocean.com/docs/spaces/), LocalStorage.
# Installation
To install, simply use `pip` or `easy_install`:
```bash
$ pip install --upgrade storedoc
```
or
```bash
$ easy_install --upgrade storedoc
```
------------
# Get Started
#### Upload to AWS S3 Buckets
### Initialize the service
from storedoc import Service
client = Service('aws')
### Get information of the service
client.describe()
### Instantiate AWS S3 Client
client.connect(
region_name='//s3.your-region.amazonaws.com',
endpoint_url='https://s3.amazonaws.com',
aws_access_key_id='your-access-key',
aws_secret_access_key='your-secret'
)
### Upload the file to S3 bucket (Note: File type supported <werkzeug.datastructures.FileStorage>)
client.upload_file(file, bucket='your-bucket-name')
#### Upload to DigitalOcean Spaces Buckets
### Initialize the service
from storedoc import Service
client = Service('do')
### Get information of the service
client.describe()
### Instantiate DO Spaces Client
client.connect(
region_name='your-region',
endpoint_url='https://your-region.digitaloceanspaces.com',
aws_access_key_id='your-access-key',
aws_secret_access_key='your-secret'
)
### Upload the file to S3 bucket (Note: File type supported <werkzeug.datastructures.FileStorage>)
client.upload_file(file, bucket='your-bucket-name')
#### Save File to Local Storage
### Initialize the service
from storedoc import Service
client = LocalStorage()
### Save file to working directory (Note: File type supported <werkzeug.datastructures.FileStorage>)
client.save_file(file)
### Save file to specific directory (Note: File type supported <werkzeug.datastructures.FileStorage>)
client.save_file(file, folder='some-directory-name')
------
## Third Party Libraries and Dependencies
The following libraries will be installed when you install the client library:
* [boto3](https://boto3.amazonaws.com/v1/documentation/api/latest/index.html) (Amazon Web Services SDK for Python)
## To-Dos
- Test cases.
## Contribute
1. Look for an open [issue](https://github.com/rakeshgunduka/storedoc/issues) or create new issue to get a dialog going about the new feature or bug that you've discovered.
2. Fork the [repository](https://github.com/rakeshgunduka/storedoc) on Github to start making your changes to the master branch (or branch off of it).
3. Write a test which shows that the bug was fixed or that the feature works as expected.
4. Make a pull request.
A python module to upload files on cloud. Supported services - [AWS S3](https://aws.amazon.com/s3/), [DigitalOcean Spaces](https://www.digitalocean.com/docs/spaces/), LocalStorage.
# Installation
To install, simply use `pip` or `easy_install`:
```bash
$ pip install --upgrade storedoc
```
or
```bash
$ easy_install --upgrade storedoc
```
------------
# Get Started
#### Upload to AWS S3 Buckets
### Initialize the service
from storedoc import Service
client = Service('aws')
### Get information of the service
client.describe()
### Instantiate AWS S3 Client
client.connect(
region_name='//s3.your-region.amazonaws.com',
endpoint_url='https://s3.amazonaws.com',
aws_access_key_id='your-access-key',
aws_secret_access_key='your-secret'
)
### Upload the file to S3 bucket (Note: File type supported <werkzeug.datastructures.FileStorage>)
client.upload_file(file, bucket='your-bucket-name')
#### Upload to DigitalOcean Spaces Buckets
### Initialize the service
from storedoc import Service
client = Service('do')
### Get information of the service
client.describe()
### Instantiate DO Spaces Client
client.connect(
region_name='your-region',
endpoint_url='https://your-region.digitaloceanspaces.com',
aws_access_key_id='your-access-key',
aws_secret_access_key='your-secret'
)
### Upload the file to S3 bucket (Note: File type supported <werkzeug.datastructures.FileStorage>)
client.upload_file(file, bucket='your-bucket-name')
#### Save File to Local Storage
### Initialize the service
from storedoc import Service
client = LocalStorage()
### Save file to working directory (Note: File type supported <werkzeug.datastructures.FileStorage>)
client.save_file(file)
### Save file to specific directory (Note: File type supported <werkzeug.datastructures.FileStorage>)
client.save_file(file, folder='some-directory-name')
------
## Third Party Libraries and Dependencies
The following libraries will be installed when you install the client library:
* [boto3](https://boto3.amazonaws.com/v1/documentation/api/latest/index.html) (Amazon Web Services SDK for Python)
## To-Dos
- Test cases.
## Contribute
1. Look for an open [issue](https://github.com/rakeshgunduka/storedoc/issues) or create new issue to get a dialog going about the new feature or bug that you've discovered.
2. Fork the [repository](https://github.com/rakeshgunduka/storedoc) on Github to start making your changes to the master branch (or branch off of it).
3. Write a test which shows that the bug was fixed or that the feature works as expected.
4. Make a pull request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
storedoc-0.1.1.tar.gz
(3.5 kB
view details)
Built Distributions
File details
Details for the file storedoc-0.1.1.tar.gz
.
File metadata
- Download URL: storedoc-0.1.1.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.15.0 CPython/3.5.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e36c340a30bc70ac6b903273345a11dd39f1bcfd462184591af3a076e8e69792 |
|
MD5 | db349be54f36aa53ad9b78be9ba218d6 |
|
BLAKE2b-256 | e48c6de48e7be77c22bc69b45681c5cc9f05339a93ba9391179b6e212cab21f4 |
File details
Details for the file storedoc-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: storedoc-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.15.0 CPython/3.5.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfd3018e0c371e18b1b6359fb0635a3ba07244368c6d22b7afa90b15b2c02cc0 |
|
MD5 | 73f008248c2cd3dabed7165b084dd854 |
|
BLAKE2b-256 | 0d78013c42b19f8aa8f0d69ecc4799246df758f50a8d07a60b314452060077ae |
File details
Details for the file storedoc-0.1.1-py2-none-any.whl
.
File metadata
- Download URL: storedoc-0.1.1-py2-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.19.1 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.15.0 CPython/3.5.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95ba5c61ad8ac4938d2837a3cc4e6d4d26c1e739f70cf2b1db963ced2a56625b |
|
MD5 | 731def218a3df7f9c0323bfe292eb61c |
|
BLAKE2b-256 | 02f26f606b724fafc7a4bf8e6083a8c133fa33367959b8257f95232a0a6d1ce7 |