Skip to main content

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 partners_utils.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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aio_s3_storages-0.0.1.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

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

aio_s3_storages-0.0.1-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

Details for the file aio_s3_storages-0.0.1.tar.gz.

File metadata

  • Download URL: aio_s3_storages-0.0.1.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.3 Linux/6.11.0-1015-azure

File hashes

Hashes for aio_s3_storages-0.0.1.tar.gz
Algorithm Hash digest
SHA256 bbbbaa4ad56ea772aea5340ba2f200604cc125d0ce16e2f62c2c09e95a797344
MD5 c7465798bf1b38f4f5c981f9b7bbd827
BLAKE2b-256 f5a9f47e8c1a2a6a1de0754b15171d97de90197adadfd58db98559fe3b241223

See more details on using hashes here.

File details

Details for the file aio_s3_storages-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: aio_s3_storages-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.3 Linux/6.11.0-1015-azure

File hashes

Hashes for aio_s3_storages-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fe3875636ecf6295f97e9f945f92b7dc00f31dfd7f2c5cffd5dd4dd941720180
MD5 71e1d6a848e0c8f959cc1cc1c17b9b15
BLAKE2b-256 8397d97129a533d5a8357a4d2e4294eda768b2c29978939560ef893e44626f47

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