Skip to main content

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


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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

assetsstore-1.8.8-py2.py3-none-any.whl (32.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file assetsstore-1.8.8.tar.gz.

File metadata

  • Download URL: assetsstore-1.8.8.tar.gz
  • Upload date:
  • Size: 70.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.4

File hashes

Hashes for assetsstore-1.8.8.tar.gz
Algorithm Hash digest
SHA256 3e992c81578705a5ded2c183f9aa33860cad6ed5465d515fe7abeee04ee85c11
MD5 983b884c31d1e82b8c7311cabb7dfa69
BLAKE2b-256 f3e5f4cafe1586a34f1ef7a12e041fe3cb5429d619327c1c47698237e59454f5

See more details on using hashes here.

File details

Details for the file assetsstore-1.8.8-py2.py3-none-any.whl.

File metadata

  • Download URL: assetsstore-1.8.8-py2.py3-none-any.whl
  • Upload date:
  • Size: 32.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.4

File hashes

Hashes for assetsstore-1.8.8-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 00e670e5c7c81015f4e39bc22851511d61b16fa9a81cb4aac695d353f7a0747f
MD5 4c47b634b94fb28eb4e1844bed9deb30
BLAKE2b-256 216ee328b3cc8aea68bb6aadf6c0061b91f3b1f94385333edbb70605c12aa170

See more details on using hashes here.

Supported by

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