Skip to main content

Python helpers for Azure Storage Blob and Queue operations.

Project description

appfx-storage

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. The helpers support connection strings, but public examples intentionally use account-name authentication with managed identity or Azure CLI credentials.

set AZURE_STORAGE_ACCOUNT_NAME=your-storage-account

Use managed identity or Azure CLI login for account-name authentication. 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.0.tar.gz (37.0 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.0-py3-none-any.whl (35.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: appfx_storage-0.1.0.tar.gz
  • Upload date:
  • Size: 37.0 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.0.tar.gz
Algorithm Hash digest
SHA256 1af9b500b86a2487ccd46a37eebaee77c0d037f06dc3440316931fcaa4136fc7
MD5 75282a574868c2dbf6ac3bf6003d9f4e
BLAKE2b-256 b7641ad54225a59e33cf5948290aabacd2712bcda14542df70e4a07a3429aa57

See more details on using hashes here.

Provenance

The following attestation bundles were made for appfx_storage-0.1.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: appfx_storage-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 35.3 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9ad702df84856f201cb4a15e16ef9b16ff08a18925613d5afba78947d8fb50b8
MD5 3679c4d2a5017037b8e0ef5a75505fe3
BLAKE2b-256 dbd00bdff664bcd2d15b491d7e09527861a61a638f4e862ff0bc041d721608f2

See more details on using hashes here.

Provenance

The following attestation bundles were made for appfx_storage-0.1.0-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