Metadata-Version: 2.1
Name: spado
Version: 0.1.3
Summary: Client simplifying and abstracting common operations for digital ocean spaces.
Home-page: https://github.com/alexpdr/spado
License: GPL-3.0-or-later
Author: Alex Pedersen
Author-email: me@alexpdr.dev
Maintainer: Alex Pedersen
Maintainer-email: me@alexpdr.dev
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Requires-Dist: boto3 (>=1.13.8,<2.0.0)
Project-URL: Repository, https://github.com/alexpdr/spado
Description-Content-Type: text/markdown

# 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
```py
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
```py
_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
