aiob2


Nameaiob2 JSON
Version 0.8.5 PyPI version JSON
download
home_pagehttps://github.com/Void-ux/aiob2
SummaryA simple and easy to use async wrapper for Backblaze's B2 bucket API.
upload_time2024-07-07 12:05:14
maintainerNone
docs_urlNone
authorDan
requires_python<4.0,>=3.8
licenseMIT
keywords backblaze b2 cloud storage
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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 and its files in a modern, object-oriented fashion.

**NOTE:** There are API endpoints left to implement, eventually they will be added. To speed up this process you can submit a [pull request](https://github.com/Void-ux/aiob2/pulls) or [suggest it](https://github.com/Void-ux/aiob2/discussions/categories/ideas).

## Installation

---

aiob2 is compatible with Python 3.8+. 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": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.8",
    "maintainer_email": null,
    "keywords": "backblaze, b2, cloud, storage",
    "author": "Dan",
    "author_email": "the.void.altacc@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/20/69/dff2b17b0ddce6e42b80888bdc1190896b72b3058b69dc0985623ffacd88/aiob2-0.8.5.tar.gz",
    "platform": null,
    "description": "# aiob2\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 and its files in a modern, object-oriented fashion.\n\n**NOTE:** There are API endpoints left to implement, eventually they will be added. To speed up this process you can submit a [pull request](https://github.com/Void-ux/aiob2/pulls) or [suggest it](https://github.com/Void-ux/aiob2/discussions/categories/ideas).\n\n## Installation\n\n---\n\naiob2 is compatible with Python 3.8+. 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\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.5",
    "project_urls": {
        "Bug Tracker": "https://github.com/Void-ux/aiob2/issues/",
        "Documentation": "https://aiob2.readthedocs.io/en/latest/",
        "Homepage": "https://github.com/Void-ux/aiob2",
        "Repository": "https://github.com/Void-ux/aiob2"
    },
    "split_keywords": [
        "backblaze",
        " b2",
        " cloud",
        " storage"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "937710d6b384048cc41062028de99c03cc7d61fe87e48ed7b4a9dd8eb9ea001b",
                "md5": "c98e2351375fa465c79b05ad0d670d3b",
                "sha256": "e5661c2db7ec1cb19e3a55d6c7306a27e4876042316915cbd1ff22756f5a0dee"
            },
            "downloads": -1,
            "filename": "aiob2-0.8.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c98e2351375fa465c79b05ad0d670d3b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.8",
            "size": 23174,
            "upload_time": "2024-07-07T12:05:12",
            "upload_time_iso_8601": "2024-07-07T12:05:12.215174Z",
            "url": "https://files.pythonhosted.org/packages/93/77/10d6b384048cc41062028de99c03cc7d61fe87e48ed7b4a9dd8eb9ea001b/aiob2-0.8.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2069dff2b17b0ddce6e42b80888bdc1190896b72b3058b69dc0985623ffacd88",
                "md5": "040315518c558904cf4086ee118bfc87",
                "sha256": "f5b70f21356b76a7cb421e437518bfbdc26eb2580a07277e2cca257d806a5f3a"
            },
            "downloads": -1,
            "filename": "aiob2-0.8.5.tar.gz",
            "has_sig": false,
            "md5_digest": "040315518c558904cf4086ee118bfc87",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.8",
            "size": 19613,
            "upload_time": "2024-07-07T12:05:14",
            "upload_time_iso_8601": "2024-07-07T12:05:14.193936Z",
            "url": "https://files.pythonhosted.org/packages/20/69/dff2b17b0ddce6e42b80888bdc1190896b72b3058b69dc0985623ffacd88/aiob2-0.8.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-07 12:05:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Void-ux",
    "github_project": "aiob2",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "aiob2"
}
        
Dan
Elapsed time: 0.44655s