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
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 details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file blob-az-0.2.4.tar.gz.
File metadata
- Download URL: blob-az-0.2.4.tar.gz
- Upload date:
- Size: 4.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/5.0.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb02cd40d95a5d212b40fdca33b358bef81752e3c1d8f5592797c40680103158
|
|
| MD5 |
cdb42717fc8686be69a9a53873852f5b
|
|
| BLAKE2b-256 |
6fde2dfb203dc5f6f78835c1b952b1e8f5c5e581bf0451b4d755af25a987ece9
|
File details
Details for the file blob_az-0.2.4-py3-none-any.whl.
File metadata
- Download URL: blob_az-0.2.4-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/5.0.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9c2e3f94cd6a8f6d3c18cc2e4f5034e79a86c8badcfa3afb292ebd8e67e06295
|
|
| MD5 |
ec8d25e66f936a9203039351d126ceac
|
|
| BLAKE2b-256 |
4babf0fef6a1149b4441752e31e5ce24e3c9de19d589f78c7de9e60f9f0a9eee
|