Skip to main content

A simple and easy to use async wrapper for Backblaze's B2 bucket API.

Project description


Python version Build status PyPi License

aiob2 is an asynchronous API wrapper for the Backblaze B2 Bucket API.

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 or suggest it.


aiob2 is compatible with Python 3.8+. To install aiob2, run the following command in your (virtual) environment.

pip install aiob2

Alternatively, for the latest though least stable version, you can download it from the GitHub repo:

pip install git+



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 =

async def main():
    async with Client('key_id', 'key') as client:
        file = await client.upload_file(

if __name__ == '__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


This project is released under the MIT License.

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

aiob2-0.8.5.tar.gz (19.6 kB view hashes)

Uploaded Source

Built Distribution

aiob2-0.8.5-py3-none-any.whl (23.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page