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
Release files for aio-s3-storages 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aio_s3_storages-0.0.2.tar.gz | 8.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aio_s3_storages-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.6 kB
Release files / aio_s3_storages-0.0.2.tar.gz
| Download URL | aio_s3_storages-0.0.2.tar.gz |
|---|---|
| Size | 8.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
29cb8c91b42699f356add81fae458537216a8489660e946a5d8beea8ee194e41
|
|
BLAKE2b-256 checksum How to use checksums |
c5cdff717b7693c0f182fa69847fa7d526a1a6a4a37df67302151a37c53ce4ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.12.3 Linux/6.11.0-1018-azure
|
Release files / aio_s3_storages-0.0.2-py3-none-any.whl
| Download URL | aio_s3_storages-0.0.2-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4b341f157730f62df534aa3637213864b073bef755c1fb730472fb4f245d57a5
|
|
BLAKE2b-256 checksum How to use checksums |
f8898d697030f7cbca5f7b8042eea93bd63f96e9a1fc579698c8e65ee63ff52f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.12.3 Linux/6.11.0-1018-azure
|