Skip to main content

A python library to upload files on cloud. Supported services - AWS S3, DigitalOcean Spaces, LocalStorage.

Project description

Storedoc 0.1.2

A python module to upload files on cloud. Supported services - AWS S3, DigitalOcean Spaces, LocalStorage.

Installation

To install, simply use pip or easy_install:

$ pip install --upgrade storedoc

or

$ 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='//s3.your-region.amazonaws.com',
    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 (Amazon Web Services SDK for Python)

To-Dos

  • Test cases.

Contribute

  1. Look for an open issue or create new issue to get a dialog going about the new feature or bug that you've discovered.
  2. Fork the repository 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


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.3.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

storedoc-0.1.3-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file storedoc-0.1.3.tar.gz.

File metadata

  • Download URL: storedoc-0.1.3.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for storedoc-0.1.3.tar.gz
Algorithm Hash digest
SHA256 5a3e2758c619ecd6e718d9ba151e45b1b2eda9235cd957626d297547a30b9d5c
MD5 65af2b9d1d0eb5cefa8d477fbbcbc0c3
BLAKE2b-256 a5637e93ba6be0ad4a2ce146934a214cb1161ef4658d6738da180f19f966241c

See more details on using hashes here.

File details

Details for the file storedoc-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: storedoc-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

File hashes

Hashes for storedoc-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6d1d1c980bddf4967100d53e95157a8ce0870f730113d3711b6838955369104e
MD5 688c1ebd8990ff9aa7b48f596fdab898
BLAKE2b-256 ee90c96855145ed68e68a455176510230cd15246ded76458aab22fe3effbcea7

See more details on using hashes here.

Supported by

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