Name | ConnectKit-S3 JSON |
Version |
1.3.1
JSON |
| download |
home_page | None |
Summary | Wrapper for connection to S3 |
upload_time | 2024-06-11 10:30:15 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | The MIT License (MIT)
Copyright © 2024 MTUCI Open Source
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
keywords |
connectkit
s3
boto3
async
asyncio
aioboto3
aiofiles
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# ConnectKit S3 [*en*|[ru](./README_RU.md)]
___
ConnectKit S3 is a wrapper for boto3 and aioboto3 to simplify working with S3 storages.
Includes pydantic settings, template code.
## Installation
___
To install the sync version:
```shell
pip install ConnectKit-S3
```
To install the async version:
```shell
pip install ConnectKit-S3[async]
```
## Usage
___
These variables from settings are used for connection by default.
All variables are optional.
The first four are responsible for setting up the default connection,
you need to specify everything except the region to enable it.
Bucket is used by default unless another one is programmatically selected.
Variables are extracted from the environment:
AWS_HOST=str # Address of S3 server
AWS_ACCESS_KEY_ID=str # Access key
AWS_SECRET_ACCESS_KEY=str # Secret key
AWS_REGION=str # Region, optional
AWS_BUCKET=str # Default bucket
These variables can be overridden:
```python
from s3.settings import settings
settings.AWS_BUCKET = "some_bucket"
```
> **!! Attention !!**
> After creating a default connection, changing the settings variables for it is ignored.
The `s3` and `async_s3` functions are used to open the connection.
Uploading and downloading files requires:
* Synchronous mode requires a synchronous file descriptor open in binary mode.
* Asynchronous mode requires the aiofiles binary file descriptor
```python
from s3 import s3, async_s3
# Synchronous
client = s3()
if client.has_file("s3_filename"):
pass
# Asynchronous
client = async_s3
async with client() as conn:
if conn.has_file("s3_filename"):
pass
```
## License
___
ConnectKit S3 is [MIT License](./LICENSE).
Raw data
{
"_id": null,
"home_page": null,
"name": "ConnectKit-S3",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "connectkit, s3, boto3, async, asyncio, aioboto3, aiofiles",
"author": null,
"author_email": "RealMetamorph <andr.timchuk@yandex.ru>",
"download_url": "https://files.pythonhosted.org/packages/38/2b/83d2197fdbec81038d109083c2382a214795a83d13026cda762fc47c7ee1/connectkit_s3-1.3.1.tar.gz",
"platform": null,
"description": "# ConnectKit S3 [*en*|[ru](./README_RU.md)]\n\n___\n\nConnectKit S3 is a wrapper for boto3 and aioboto3 to simplify working with S3 storages.\n\nIncludes pydantic settings, template code.\n\n## Installation\n\n___\n\nTo install the sync version:\n\n```shell\npip install ConnectKit-S3\n```\n\nTo install the async version:\n\n```shell\npip install ConnectKit-S3[async]\n```\n\n## Usage\n\n___\nThese variables from settings are used for connection by default.\nAll variables are optional.\n\nThe first four are responsible for setting up the default connection,\nyou need to specify everything except the region to enable it.\n\nBucket is used by default unless another one is programmatically selected.\n\nVariables are extracted from the environment:\n\n AWS_HOST=str # Address of S3 server\n AWS_ACCESS_KEY_ID=str # Access key\n AWS_SECRET_ACCESS_KEY=str # Secret key\n AWS_REGION=str # Region, optional\n AWS_BUCKET=str # Default bucket\n\nThese variables can be overridden:\n\n```python\nfrom s3.settings import settings\n\nsettings.AWS_BUCKET = \"some_bucket\"\n```\n\n> **!! Attention !!**\n> After creating a default connection, changing the settings variables for it is ignored.\n\nThe `s3` and `async_s3` functions are used to open the connection.\n\nUploading and downloading files requires:\n\n* Synchronous mode requires a synchronous file descriptor open in binary mode.\n* Asynchronous mode requires the aiofiles binary file descriptor\n\n```python\nfrom s3 import s3, async_s3\n\n# Synchronous\nclient = s3()\nif client.has_file(\"s3_filename\"):\n pass\n\n# Asynchronous\nclient = async_s3\n\nasync with client() as conn:\n if conn.has_file(\"s3_filename\"):\n pass\n\n```\n\n## License\n\n___\n\nConnectKit S3 is [MIT License](./LICENSE).",
"bugtrack_url": null,
"license": "The MIT License (MIT)\n Copyright \u00a9 2024 MTUCI Open Source\n \n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \u201cSoftware\u201d), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \u201cAS IS\u201d, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.",
"summary": "Wrapper for connection to S3",
"version": "1.3.1",
"project_urls": {
"Homepage": "https://github.com/mtuciru/ConnectKit-S3",
"Repository": "https://github.com/mtuciru/ConnectKit-S3.git"
},
"split_keywords": [
"connectkit",
" s3",
" boto3",
" async",
" asyncio",
" aioboto3",
" aiofiles"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "eb4980f4c726225206e3e52afcffbeffac939fb5dbdac1cb461cf227f85f375c",
"md5": "cca1b7acd9194033ac5814df4746d6f4",
"sha256": "5437cdbe68576edfd0d31c540fced5cebd53936e9ba8396420f2171beb090e22"
},
"downloads": -1,
"filename": "connectkit_s3-1.3.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "cca1b7acd9194033ac5814df4746d6f4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 6424,
"upload_time": "2024-06-11T10:30:13",
"upload_time_iso_8601": "2024-06-11T10:30:13.989806Z",
"url": "https://files.pythonhosted.org/packages/eb/49/80f4c726225206e3e52afcffbeffac939fb5dbdac1cb461cf227f85f375c/connectkit_s3-1.3.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "382b83d2197fdbec81038d109083c2382a214795a83d13026cda762fc47c7ee1",
"md5": "34a2b678e0efd7324b3a959add5c4225",
"sha256": "190f021b52bd7059fc1e3ad64432f2e2ad2ee00ddb6de5bc8ef5d96e0021e5fb"
},
"downloads": -1,
"filename": "connectkit_s3-1.3.1.tar.gz",
"has_sig": false,
"md5_digest": "34a2b678e0efd7324b3a959add5c4225",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 4551,
"upload_time": "2024-06-11T10:30:15",
"upload_time_iso_8601": "2024-06-11T10:30:15.969158Z",
"url": "https://files.pythonhosted.org/packages/38/2b/83d2197fdbec81038d109083c2382a214795a83d13026cda762fc47c7ee1/connectkit_s3-1.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-11 10:30:15",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mtuciru",
"github_project": "ConnectKit-S3",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "connectkit-s3"
}