Skip to main content

Client simplifying and abstracting common operations for digital ocean spaces.

Project description

Spado (Digital Ocean spaces client)

Spado is a simple client to interact with Digital Ocean's spaces. It's built on top of the AWS python 3 framwork boto3 and aims to simplify and streamline common storage operations.

Usage

Initialization

from spado import Spado

# Required params
params: dict = {
    space_name: "space_name",
    region_name: "region_name",
    endpoint: "endpoint",
    spaces_key: "spaces_key",
    spaces_secret: "space_token"
}

_client: Spado = Spado(**params)

Method usage

_client.upload(
    filepath="Samples/sample.jpg",  # Folder/filename.extension
    file=open('/tmp/sample.jpg', 'rb'),  # File as <bytes>
    acl="private"
)

_client.download(
    spaces_fpath='Samples/sample.jpg',
    local_fpath='/tmp/sample2.jpg'
)

CRUD methods:

  • upload: Adds a new file to spaces
  • download_url: Returns a download link for a file in spaces
  • download: Downloads the file directly to given filepath
  • replace: Replaces a file in spaces with a new one
  • delete: Deletes a file in spaces

Helper methods:

  • list_files: Returns a list of files in default space
  • list_spaces: Returns a list of available spaces

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

spado-0.1.3.tar.gz (15.0 kB view hashes)

Uploaded Source

Built Distribution

spado-0.1.3-py3-none-any.whl (15.1 kB view hashes)

Uploaded Python 3

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