Python package for managing file upload/download via selected file system.
Project description
Assets Store
Github
This library was created to simplify the upload/download of files from/to S3, Azure Storage, or your desired server.
Setup instructions
The project is using python 3.12, it relies on boto3 lib for S3, azure-storage-blob for AzureStorage, and paramiko for server connections.
How to use
Install with pip depending on which type of storage do you use (s3,server,azure,minio are choices):
pip install AssetsStore[s3]
Set environment variables dependent on what upload you are using:
- AzureStorage
ASSET_STORE=AzureFiles
ASSET_ACCESS_KEY="put_access_key"
ASSET_SECRET_ACCESS_KEY="put_access_key_secret"
ASSET_LOCATION="name_of_the_blob"
ASSET_PUBLIC_URL="blob_public_url"
LOCAL_STORE=path_to_download_folder
- S3
ASSET_STORE=S3Files
ASSET_ACCESS_KEY="put_access_key"
ASSET_SECRET_ACCESS_KEY="put_access_key_secret"
ASSET_LOCATION="name_of_the_bucket"
ASSET_PUBLIC_URL="blob_public_url"
ASSET_REGION="s3_region"
LOCAL_STORE=path_to_download_folder
- for local development
ASSET_STORE=LocalFiles
ASSET_LOCATION="path_to_folder"
ASSET_PUBLIC_URL="local_url_if_folder_hosted"
LOCAL_STORE=path_to_download_folder
The library has the ability to use Rebrand and to use it add these envs:
REBRAND_KEY="rebrand_key"
REBRAND_DOMAIN='rebrand_domain'
Usage example
from assetsstore.assets import FileAssets
assets = FileAssets.get_asset() # setup asset store
assets.put_file("some_file.txt") # Upload file from local download folder
assets.get_file("some_file.txt") # Download file to local download folder
assets.del_local_file("some_file.txt") # Delete file from local download folder
assets.del_file("some_file.txt") # Deletes file from server
Authors
Deployment to PyPI
flit build
flit publish
Contributing
Contributions are always welcome! :)
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
assetsstore-1.3.0.tar.gz
(19.5 kB
view hashes)
Built Distribution
Close
Hashes for assetsstore-1.3.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c208ca2f4e43a7d71cabc36e6b74af63d14402033f314ef180448272fc2b5786 |
|
MD5 | 272c8dcafb1e9f5952fe09aede35fd46 |
|
BLAKE2b-256 | 6fd1dae65f772d29439de47af2119578f74736c3e418d97cdfe4d2f0049203e5 |