Skip to main content

aiob2


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, 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.

pip install aiob2

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

pip install git+https://github.com/Void-ux/aiob2.git

Usage

Uploading

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

License


This project is released under the MIT License.

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.2.tar.gz (19.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aiob2-0.8.2-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file aiob2-0.8.2.tar.gz.

File metadata

  • Download URL: aiob2-0.8.2.tar.gz
  • Upload date:
  • Size: 19.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.2 Windows/10

File hashes

Hashes for aiob2-0.8.2.tar.gz
Algorithm Hash digest
SHA256 8ad83213343513b90d3c2803b164bf9cb1e1d4e483f803fbae49357993ee1768
MD5 89358810ef8631180699057be9287a2c
BLAKE2b-256 e366bce8e9f3e01b0ff6597bde323b22b58a293e301f7975298cf665b88942a8

See more details on using hashes here.

File details

Details for the file aiob2-0.8.2-py3-none-any.whl.

File metadata

  • Download URL: aiob2-0.8.2-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.2 Windows/10

File hashes

Hashes for aiob2-0.8.2-py3-none-any.whl
Algorithm Hash digest
SHA256 82edc538bfdf1cfb3912c3d93b531dda89d26b9f9381ebc06c834816d63c8978
MD5 8fd08754d00dc5c64d649bf6667caae1
BLAKE2b-256 5cebf1d43ccd97b712117adb769041e663a9b96474837ee2427e204dbbc5442c

See more details on using hashes here.

Supported by

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