Skip to main content

Backblaze B2 Asynchronous Wrapper.

Project description

GitHub issues GitHub license Actions Status

Index

About

aiob2 is a powerful & simple asynchronous wrapper for Backblaze's b2 API. Version 1.0.0 is considered a rewrite and as a result everything below that version is incompatible.

Install

  • Pypi: pip3 install aiob2
  • Git: pip3 install git+https://github.com/WardPearce/aiob2.git

Example

import aiob2
import asyncio
import aiohttp

from uuid import uuid4


B2 = aiob2.client(key_id="...", application_key="...")


async def example():
    try:
        await B2.connect(
            aiohttp.ClientSession()
        )
    except aiob2.exceptions.InvalidAuthorization:
        print("Invalid account details.")
    else:
        bucket = B2.bucket()

        await bucket.create(
            "bucket-{}".format(uuid4()),
            aiob2.bucket.models.BucketTypes.private
        )

        await bucket.delete()

    await B2.close()

loop = asyncio.get_event_loop()
loop.run_until_complete(example())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for aiob2, version 1.0.4
Filename, size File type Python version Upload date Hashes
Filename, size aiob2-1.0.4-py3-none-any.whl (31.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size aiob2-1.0.4.tar.gz (11.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page