# safe-s3-storage
S3 tools for uploading files to S3 safely (antivirus check, etc) as well as downloading and deleting files.
## How To Use
```
uv add safe-s3-storage
poetry add safe-s3-storage
```
## Retries on S3 errors
safe-s3-storage doesn't provide any retries on S3 errors. You should configure in `S3Client`:
```python
import typing
import aioboto3
from aiobotocore.config import AioConfig
from types_aiobotocore_s3 import S3Client
from application.settings import settings
async def create_s3_resource() -> typing.AsyncIterator[S3Client]:
s3_session: typing.Final = aioboto3.Session(
aws_access_key_id=settings.s3_access_key_id,
aws_secret_access_key=settings.s3_secret_access_key.get_secret_value(),
)
async with s3_session.client(
"s3",
endpoint_url=str(settings.s3_endpoint_url),
config=AioConfig(retries={"max_attempts": 3, "mode": "standard"}),
) as s3_client:
yield s3_client
```
Raw data
{
"_id": null,
"home_page": null,
"name": "safe-s3-storage",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.12",
"maintainer_email": null,
"keywords": "antivirus, kaspersky, s3, upload",
"author": "community-of-python",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/22/4f/8cd6ea74aa3cbc23a2658ae971e93e89a3cc1736bb829ddff51289903e29/safe_s3_storage-0.8.1.tar.gz",
"platform": null,
"description": "# safe-s3-storage\n\nS3 tools for uploading files to S3 safely (antivirus check, etc) as well as downloading and deleting files.\n\n## How To Use\n\n```\nuv add safe-s3-storage\npoetry add safe-s3-storage\n```\n\n## Retries on S3 errors\n\nsafe-s3-storage doesn't provide any retries on S3 errors. You should configure in `S3Client`:\n\n```python\nimport typing\n\nimport aioboto3\nfrom aiobotocore.config import AioConfig\nfrom types_aiobotocore_s3 import S3Client\n\nfrom application.settings import settings\n\n\nasync def create_s3_resource() -> typing.AsyncIterator[S3Client]:\n s3_session: typing.Final = aioboto3.Session(\n aws_access_key_id=settings.s3_access_key_id,\n aws_secret_access_key=settings.s3_secret_access_key.get_secret_value(),\n )\n async with s3_session.client(\n \"s3\",\n endpoint_url=str(settings.s3_endpoint_url),\n config=AioConfig(retries={\"max_attempts\": 3, \"mode\": \"standard\"}),\n ) as s3_client:\n yield s3_client\n\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "S3 safe storage",
"version": "0.8.1",
"project_urls": null,
"split_keywords": [
"antivirus",
" kaspersky",
" s3",
" upload"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "7899e928ace80a1ee52421f43c8ab725bc268cefc227fde1c239683e42db68cf",
"md5": "2a98a88312ac48780d2c44358eecd786",
"sha256": "9c6b2ea29deaf2b25636ab85a66da5cd1bce957ac94d51147bd7881633333f99"
},
"downloads": -1,
"filename": "safe_s3_storage-0.8.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2a98a88312ac48780d2c44358eecd786",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.12",
"size": 7309,
"upload_time": "2025-07-08T11:11:10",
"upload_time_iso_8601": "2025-07-08T11:11:10.703060Z",
"url": "https://files.pythonhosted.org/packages/78/99/e928ace80a1ee52421f43c8ab725bc268cefc227fde1c239683e42db68cf/safe_s3_storage-0.8.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "224f8cd6ea74aa3cbc23a2658ae971e93e89a3cc1736bb829ddff51289903e29",
"md5": "4680e561453d0c596410e22d5ecd9aa1",
"sha256": "e078b070ad5d9d149fe877abc775474fe521ea1b5a53204cdba36cac06b02c51"
},
"downloads": -1,
"filename": "safe_s3_storage-0.8.1.tar.gz",
"has_sig": false,
"md5_digest": "4680e561453d0c596410e22d5ecd9aa1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.12",
"size": 8282,
"upload_time": "2025-07-08T11:11:11",
"upload_time_iso_8601": "2025-07-08T11:11:11.836218Z",
"url": "https://files.pythonhosted.org/packages/22/4f/8cd6ea74aa3cbc23a2658ae971e93e89a3cc1736bb829ddff51289903e29/safe_s3_storage-0.8.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-08 11:11:11",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "safe-s3-storage"
}