Skip to main content

A high-level Azure Service Bus abstraction for publishing, consuming, and DLQ workflows.

Project description

asbflow

asbflow is a Python library built on top of the Microsoft Azure Service Bus SDK that abstracts the most common messaging workflows.

Workflow Status

Dev CI Main CI Release

It provides a clean service API for:

  • publishing to topics and queues,
  • consuming from subscriptions and queues,
  • managing dead-letter queue (DLQ) operations.

The library is model-agnostic by default and integrates with Pydantic parsing when you want typed payload validation.

Why asbflow

  • Keep Azure Service Bus integration explicit but compact.
  • Reuse the same high-level APIs across projects.
  • Control parse behavior and settlement behavior per call.
  • Use strategy-based execution (sequential, thread_pool, async) without changing business code.

Core Components

  • ASBPublisher: publish payloads (dict or Pydantic models).
  • ASBConsumer: consume (settling) or read (non-settling) messages.
  • ASBDLQManager: read/consume/redrive/purge DLQ messages.
  • ASBClientProvider: pluggable auth provider (connection string or managed identity).
  • Entity abstraction: topic/queue sender and receiver access via dedicated entity clients.

Installation

pip install asbflow

For local development:

pip install -e .[dev]

For notebook quickstarts:

pip install -e .[notebook]

Quick Start

from asbflow import (
    ASBConnectionConfig,
    ASBConsumer,
    ASBConsumerConfig,
    ASBPublisher,
    ASBPublisherConfig,
)

connection = ASBConnectionConfig(
    connection_string="<connection-string>",
)

publisher = ASBPublisher(
    connection=connection,
    publisher=ASBPublisherConfig(topic_name="<topic-name>"),
)

consumer = ASBConsumer(
    connection=connection,
    consumer=ASBConsumerConfig(
        topic_name="<topic-name>",
        subscription_name="<subscription-name>",
    ),
)

publisher.publish(payload={"id": "a1", "severity": "high"}, parse=False)
result = consumer.consume(parse=False, raise_on_error=False)
print(result.succeeded, result.failed)

A richer walkthrough is available in quickstart/, including quickstart/asbflow_quickstart.ipynb.

Design Principles

  • Abstraction over boilerplate, not over behavior.
  • Safe defaults with explicit overrides.
  • Uniform result contracts (succeeded, failed, successes, failures).
  • Structured logging across services and strategies.

Development

Run tests:

pytest -q test/unit

Build package:

python -m build

CI/CD Branch Model

The repository ships with branch-oriented GitHub Actions:

  • dev: fast CI feedback (tests + quality checks).
  • main: full CI matrix + package build verification.
  • release: release validation and publish workflow.

Roadmap

  • More built-in payload parser adapters.
  • Additional reliability patterns around retries/backoff.
  • Optional observability integrations (metrics/tracing).

License

MIT. See LICENSE.

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

asbflow-1.0.1.tar.gz (29.7 kB view details)

Uploaded Source

Built Distribution

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

asbflow-1.0.1-py3-none-any.whl (47.1 kB view details)

Uploaded Python 3

File details

Details for the file asbflow-1.0.1.tar.gz.

File metadata

  • Download URL: asbflow-1.0.1.tar.gz
  • Upload date:
  • Size: 29.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for asbflow-1.0.1.tar.gz
Algorithm Hash digest
SHA256 2784b56383188ed6464068c15d63e1edb2ab76fe9176a2b925621a0e12c6cd52
MD5 cfcfeb3c6b7c026ea4540e9c0000bf28
BLAKE2b-256 6122b13416b376943d5470b0f7403234dad157d7f9b4b66b7bb67fa73b82c941

See more details on using hashes here.

Provenance

The following attestation bundles were made for asbflow-1.0.1.tar.gz:

Publisher: release.yml on iFoxz17/asbflow

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

File details

Details for the file asbflow-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: asbflow-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 47.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for asbflow-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9e1f8189266e5469673613f60704918e8985e910e5f628425faf6b7dad85b90c
MD5 a76835bf1df385c7e14c4efa2efa0a95
BLAKE2b-256 4bd8c147fab95e979a8624e07fd0c871ccc8c2d8131f9cbbfe7a2eea694dd957

See more details on using hashes here.

Provenance

The following attestation bundles were made for asbflow-1.0.1-py3-none-any.whl:

Publisher: release.yml on iFoxz17/asbflow

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