Skip to main content

Python helpers for Azure Storage Blob and Queue operations.

Project description

appfx-storage

CI Publish PyPI Python versions License: MIT

Python helpers for Azure Storage Blob and Queue operations.

The appfx-storage package exposes the appfx.storage import namespace. It wraps common Azure Blob Storage and Azure Queue Storage tasks with sync and async helper classes, typed package metadata, and release-ready packaging.

Features

  • Blob container and blob upload, download, listing, delete, metadata, and SAS URL helpers.
  • Queue create, send, receive, peek, update, delete, clear, and worker-pattern helpers.
  • Sync and async clients for both blob and queue operations.
  • Azure credential support through connection strings, account names, managed identity, and DefaultAzureCredential.
  • Python 3.12 and 3.13 support.

Installation

python -m pip install appfx-storage

For local development:

python -m pip install -e ".[dev]"

Quickstart

Set the storage account name before running examples. When account_name is provided, the helpers use Azure Identity DefaultAzureCredential, so local development can authenticate with Azure CLI and Azure-hosted apps can use managed identity. Connection strings are supported, but examples intentionally prefer Entra ID authentication.

export AZURE_STORAGE_ACCOUNT_NAME=your-storage-account
az login

Do not commit .env files, connection strings, account keys, or generated SAS URLs.

Async blob usage

import asyncio
import os

from appfx.storage import AsyncStorageBlobHelper


async def main() -> None:
    account_name = os.environ["AZURE_STORAGE_ACCOUNT_NAME"]
    async with AsyncStorageBlobHelper(account_name=account_name) as helper:
        await helper.create_container("documents")
        await helper.upload_blob("documents", "hello.txt", "Hello from appfx-storage")
        blobs = await helper.list_blobs("documents")
        print([blob["name"] for blob in blobs])


asyncio.run(main())

Sync blob usage

import os

from appfx.storage import StorageBlobHelper


helper = StorageBlobHelper(account_name=os.environ["AZURE_STORAGE_ACCOUNT_NAME"])
helper.create_container("documents")
helper.upload_blob("documents", "hello.txt", "Hello from appfx-storage")
print(helper.list_blobs("documents"))

Async queue usage

import asyncio
import os

from appfx.storage import AsyncStorageQueueHelper


async def main() -> None:
    account_name = os.environ["AZURE_STORAGE_ACCOUNT_NAME"]
    async with AsyncStorageQueueHelper(account_name=account_name) as helper:
        await helper.create_queue("jobs")
        result = await helper.send_message("jobs", {"task": "process-file"})
        print(f"Sent message: {result['message_id']}")
        messages = await helper.receive_messages("jobs")
        print([message["message_id"] for message in messages])


asyncio.run(main())

Sync queue usage

import os

from appfx.storage import StorageQueueHelper


helper = StorageQueueHelper(account_name=os.environ["AZURE_STORAGE_ACCOUNT_NAME"])
helper.create_queue("jobs")
result = helper.send_message("jobs", {"task": "process-file"})
print(f"Next visible at: {result['next_visible_on']}")
print([message["message_id"] for message in helper.peek_messages("jobs")])

Tests and quality checks

python -m pip install -e ".[dev]"
python -m ruff check .
python -m ruff format --check .
python -m mypy
python -m pytest --cov
python -m build
python -m twine check dist/*

Live Azure tests and examples require your own Azure Storage account and credentials. Keep live credentials out of source control and CI logs.

Release notes

  • Package name: appfx-storage
  • Import namespace: appfx.storage
  • Repository: https://github.com/Dongbumlee/appfx-storage
  • PyPI publishing is configured for trusted publishing from GitHub Actions on published releases and manual workflow dispatch.

License

MIT License - see LICENSE for details.

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

appfx_storage-0.1.1.tar.gz (37.4 kB view details)

Uploaded Source

Built Distribution

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

appfx_storage-0.1.1-py3-none-any.whl (35.5 kB view details)

Uploaded Python 3

File details

Details for the file appfx_storage-0.1.1.tar.gz.

File metadata

  • Download URL: appfx_storage-0.1.1.tar.gz
  • Upload date:
  • Size: 37.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for appfx_storage-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4f84c7ac825d65ee67eada6470137def89cb1a0e587d32a49277684d43b9f44f
MD5 50debf6c44d715260cfdbd0544680fd7
BLAKE2b-256 8e0580b37e65e95c55cf06ce4f21e37db5b0a0ae190b0321d5a09054411a5419

See more details on using hashes here.

Provenance

The following attestation bundles were made for appfx_storage-0.1.1.tar.gz:

Publisher: publish.yml on Dongbumlee/appfx-storage

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file appfx_storage-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: appfx_storage-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 35.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for appfx_storage-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6eb62f5d54f58ad0251ca475758170f544fb33cfc553843621ef54720bb85509
MD5 4e21fb5d04564ed7aa58c369a9622ffc
BLAKE2b-256 a73af14d46861c8674c2d66f49d3e932030da58bafcea1ddb8ce1e2050ba1684

See more details on using hashes here.

Provenance

The following attestation bundles were made for appfx_storage-0.1.1-py3-none-any.whl:

Publisher: publish.yml on Dongbumlee/appfx-storage

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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