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.0.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.0-py3-none-any.whl (47.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: asbflow-1.0.0.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.0.tar.gz
Algorithm Hash digest
SHA256 1c22401511ed48c5d8fa3e3fae379383e66dc29cfbe917c065620cbd9984f4c1
MD5 ae230927455268b3e5f83610fa61eb5f
BLAKE2b-256 fcb557239144bf67a51f7f566298d41180948163b2a7b16fee2f6433b82ca1da

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: asbflow-1.0.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0b8cf0430bcf741c504533b71e7165c8274b2cc31affd3bd3315976071bf272c
MD5 87bd32bd1e24e88a0c324d67f9098160
BLAKE2b-256 8a3b30c2612163350cfd02a29b8ed15b994a17f736c508ebcedcf8c79736a6f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for asbflow-1.0.0-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