Asyncio-based library. S3 backend storage to simplify file management.
Project description
aio-s3-storages
S3 backend storage to simplify file management. Similar to django-storages project.
Examples
from aio_s3_storages.storage import S3Storage
class TestS3Storage(S3Storage):
bucket_name = "Bucket name"
location = "Folder name"
storage = TestS3Storage()
# get file by name
await self.storage.open(name="path_to_file")
# save file to s3 from local storage
with open("path_to_file_into_local_storage", "rb") as _file:
extra_args = {"ContentType": "content_type_file"}
await self.storage.save(name="path_to_file", content=_file, extra_args=extra_args)
# delete file
await self.storage.delete(name="path_to_file")
Environment variables
AWS_ACCESS_KEY_ID - Access key.
AWS_SECRET_ACCESS_KEY - Secret key.
AWS_USE_SSL - Use SSL encryption.
AWS_VERIFY - SSL certificate verification.
AWS_ENDPOINT_URL - Host for working with S3.
AWS_CONNECT_TIMEOUT - Maximum connection establishment time.
AWS_READ_TIMEOUT - Maximum data retrieval time.
AWS_ADDRESSING_STYLE - Addressing style.
AWS_SIGNATURE_VERSION - Signature version.
AWS_PROXIES - Proxy.
AWS_TIME_ZONE_NAME - Setting time zone (default value "Europe/Moscow").
Required
- python >=3.11, <4.0
- aioboto3 >=12.4.0, <14.0
- pydantic >=2.0.0, <3.0.0
- pydantic-settings >=2.0.0
- python-dotenv >=1.0.0
- tzdata = >=2024.1
Installation
pip install aio-s3-storages
Contributing
Before contributing please read our contributing guidelines.
Acknowledgments
I express my deep gratitude for the help in working on the project Rinat Akhtamov and Albert Alexandrov
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aio_s3_storages-0.0.2.tar.gz.
File metadata
- Download URL: aio_s3_storages-0.0.2.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29cb8c91b42699f356add81fae458537216a8489660e946a5d8beea8ee194e41
|
|
| MD5 |
65a4b3fc1878f16e1082ff51cfb9ae2c
|
|
| BLAKE2b-256 |
c5cdff717b7693c0f182fa69847fa7d526a1a6a4a37df67302151a37c53ce4ce
|
File details
Details for the file aio_s3_storages-0.0.2-py3-none-any.whl.
File metadata
- Download URL: aio_s3_storages-0.0.2-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b341f157730f62df534aa3637213864b073bef755c1fb730472fb4f245d57a5
|
|
| MD5 |
e0faf55a49369a75f8f08be2eb18f9f1
|
|
| BLAKE2b-256 |
f8898d697030f7cbca5f7b8042eea93bd63f96e9a1fc579698c8e65ee63ff52f
|