Async Python SDK for Azure Blob Storage (both block and append blobs)
Project description
Azure Blob
Installation
pip install blob-az
Authorization
The required connection string can be obtained from the Azure Portal, within the Storage account, "Access keys" tab
Environment (.env)
For convenience, you can set os.environ["BLOB_CONN_STR"]
. If you do, you can skip specifying it on every call.
E.g., create a .env
file:
BLOB_CONN_STR="<BLOB_CONN_STR>"
Then load it before importing
from dotenv import load_dotenv
load_dotenv()
import blob_az as bz
bz.client() # just works!
API
- Asynchronous (everything is a coroutine)
- Single calls or multiple using a same client:
# single call await bz.list.containers(conn_str=CONN_STR) # ain't necessary with a .env file # multiple calls async with bz.client() as client: # idem. await bz.container.create("<container-name>", client=client) cs = await bz.list.containers(client=client)
Functions
blob_az
def client(...) -> BlobServiceClient
list
async def containers(...) -> list[dict]
async def blobs(...) -> list[dict]
container
async def create(...)
async def delete(...)
blob
async def upload(...)
async def download(...) -> bytes
def url(...) -> str # generate SAS url for blob
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
blob-az-0.2.4.tar.gz
(4.9 kB
view hashes)