# aiob2
---
<p align="center">
<a href="https://www.python.org/downloads/">
<img src="https://img.shields.io/pypi/pyversions/aiob2?style=for-the-badge" alt="Python version">
</a>
<a href="https://github.com/Void-ux/aiob2/actions">
<img src="https://img.shields.io/github/actions/workflow/status/Void-ux/aiob2/build.yaml?branch=master&style=for-the-badge" alt="Build status">
</a>
<a href="https://pypi.org/project/aiob2/">
<img src="https://img.shields.io/pypi/v/aiob2?color=8BC34A&style=for-the-badge" alt="PyPi">
</a>
<a href="https://opensource.org/licenses/MIT">
<img src="https://img.shields.io/pypi/l/aiob2?color=C0C0C0&style=for-the-badge" alt="License">
</a>
</p>
aiob2 is an asynchronous API wrapper for the [Backblaze B2 Bucket API](https://www.backblaze.com/b2/docs/calling.html).
It will allow you to interact with your B2 bucket, it's files and anything else that the B2 API allows in a modern, object-oriented fashion.
**NOTE:** This API wrapper is by no means *complete* and has many endpoints to cover, though the main ones have been covered (they will be listed below)
## Installation
---
aiob2 is compatible with Python 3.8+ (this is an estimate). To install aiob2, run the following command in your (virtual) environment.
```shell
pip install aiob2
```
Alternatively, for the latest though least stable version, you can download it from the GitHub repo:
```shell
pip install git+https://github.com/Void-ux/aiob2.git
```
## Usage
### Uploading
```python
import aiohttp
import asyncio
from aiob2 import Client
# Our image to upload to our bucket
with open(r'C:\Users\MS1\Pictures\Camera Roll\IMG_5316.jpeg', 'rb') as file:
data = file.read()
async def main():
async with Client('key_id', 'key') as client:
file = await client.upload_file(
content_bytes=data,
file_name='test.jpg',
bucket_id='bucket_id',
)
if __name__ == '__main__':
asyncio.run(main())
```
And that's it! `upload_file()` returns a `File` object that neatly wraps everything Backblaze's API has provided us with.
The `File` object's documentation can be found [here](https://aiob2.readthedocs.io/en/latest/pages/api.html#aiob2.File)
## License
---
This project is released under the [MIT License](https://opensource.org/licenses/MIT).
Raw data
{
"_id": null,
"home_page": "https://github.com/Void-ux/aiob2",
"name": "aiob2",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<4.0",
"maintainer_email": "",
"keywords": "backblaze,b2,cloud,storage",
"author": "Dan",
"author_email": "the.void.altacc@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/e3/66/bce8e9f3e01b0ff6597bde323b22b58a293e301f7975298cf665b88942a8/aiob2-0.8.2.tar.gz",
"platform": null,
"description": "# aiob2\n\n---\n\n<p align=\"center\">\n <a href=\"https://www.python.org/downloads/\">\n <img src=\"https://img.shields.io/pypi/pyversions/aiob2?style=for-the-badge\" alt=\"Python version\">\n </a>\n <a href=\"https://github.com/Void-ux/aiob2/actions\">\n <img src=\"https://img.shields.io/github/actions/workflow/status/Void-ux/aiob2/build.yaml?branch=master&style=for-the-badge\" alt=\"Build status\">\n </a>\n <a href=\"https://pypi.org/project/aiob2/\">\n <img src=\"https://img.shields.io/pypi/v/aiob2?color=8BC34A&style=for-the-badge\" alt=\"PyPi\">\n </a>\n <a href=\"https://opensource.org/licenses/MIT\">\n <img src=\"https://img.shields.io/pypi/l/aiob2?color=C0C0C0&style=for-the-badge\" alt=\"License\">\n </a>\n</p>\n\naiob2 is an asynchronous API wrapper for the [Backblaze B2 Bucket API](https://www.backblaze.com/b2/docs/calling.html).\n\nIt will allow you to interact with your B2 bucket, it's files and anything else that the B2 API allows in a modern, object-oriented fashion.\n\n**NOTE:** This API wrapper is by no means *complete* and has many endpoints to cover, though the main ones have been covered (they will be listed below)\n\n## Installation\n\n---\n\naiob2 is compatible with Python 3.8+ (this is an estimate). To install aiob2, run the following command in your (virtual) environment.\n\n```shell\npip install aiob2\n```\n\nAlternatively, for the latest though least stable version, you can download it from the GitHub repo:\n\n```shell\npip install git+https://github.com/Void-ux/aiob2.git\n```\n\n## Usage\n\n### Uploading\n\n```python\nimport aiohttp\nimport asyncio\n\nfrom aiob2 import Client\n\n# Our image to upload to our bucket\nwith open(r'C:\\Users\\MS1\\Pictures\\Camera Roll\\IMG_5316.jpeg', 'rb') as file:\n data = file.read()\n\nasync def main():\n async with Client('key_id', 'key') as client:\n file = await client.upload_file(\n content_bytes=data,\n file_name='test.jpg',\n bucket_id='bucket_id',\n )\n\n\nif __name__ == '__main__':\n asyncio.run(main())\n```\n\nAnd that's it! `upload_file()` returns a `File` object that neatly wraps everything Backblaze's API has provided us with.\nThe `File` object's documentation can be found [here](https://aiob2.readthedocs.io/en/latest/pages/api.html#aiob2.File)\n\n## License\n\n---\n\nThis project is released under the [MIT License](https://opensource.org/licenses/MIT).\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A simple and easy to use async wrapper for Backblaze's B2 bucket API.",
"version": "0.8.2",
"split_keywords": [
"backblaze",
"b2",
"cloud",
"storage"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5cebf1d43ccd97b712117adb769041e663a9b96474837ee2427e204dbbc5442c",
"md5": "8fd08754d00dc5c64d649bf6667caae1",
"sha256": "82edc538bfdf1cfb3912c3d93b531dda89d26b9f9381ebc06c834816d63c8978"
},
"downloads": -1,
"filename": "aiob2-0.8.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8fd08754d00dc5c64d649bf6667caae1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 21990,
"upload_time": "2023-01-28T14:26:04",
"upload_time_iso_8601": "2023-01-28T14:26:04.143458Z",
"url": "https://files.pythonhosted.org/packages/5c/eb/f1d43ccd97b712117adb769041e663a9b96474837ee2427e204dbbc5442c/aiob2-0.8.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e366bce8e9f3e01b0ff6597bde323b22b58a293e301f7975298cf665b88942a8",
"md5": "89358810ef8631180699057be9287a2c",
"sha256": "8ad83213343513b90d3c2803b164bf9cb1e1d4e483f803fbae49357993ee1768"
},
"downloads": -1,
"filename": "aiob2-0.8.2.tar.gz",
"has_sig": false,
"md5_digest": "89358810ef8631180699057be9287a2c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 19424,
"upload_time": "2023-01-28T14:26:05",
"upload_time_iso_8601": "2023-01-28T14:26:05.608838Z",
"url": "https://files.pythonhosted.org/packages/e3/66/bce8e9f3e01b0ff6597bde323b22b58a293e301f7975298cf665b88942a8/aiob2-0.8.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-28 14:26:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "Void-ux",
"github_project": "aiob2",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "aiob2"
}