Skip to main content

Audience

Фреймворк для написания на Python асинхронных микросервисов поверх AMQP.

Особенности:

  • Декларативный стиль: Регистрация обработчиков через декораторы.
  • Два типа обработчиков: Фоновые задачи (@app.queue) и RPC-вызовы (@app.rpc).
  • Полностью асинхронный: Построен на asyncio и aio-pika.
  • Простой API: Всего несколько методов для начала работы.

Установка:

pip install audience-framework

Пример использования:

  1. Импорт модуля asyncio и класса Audience из библиотеки audience:
import asyncio

from audience import Audience
  1. Создание экземпляра приложения:
app = Audience(broker_url="amqp://admin:12345@localhost")
  1. Регистрация обработчиков очередей сообщений:
@app.queue("queue_name")
async def foo():
    ...

@app.rpc("rpc_queue_name")
async def foo():
    ...
    return { ... }
  1. Запуск приложения:
if __name__ == "__main__":
    asyncio.run(app.startup())

Дополнительные функции:

  1. Отправка сообщения в очередь:
await app.publish("queue_name", "message")
  1. Отправка RPC-запроса:
await app.rpc_call("rpc_queue_name", "message")

Metadata

Release files for audience-framework 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for audience-framework 1.0.0
File Size Uploaded Provenance
audience_framework-1.0.0.tar.gz 10.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for audience-framework 1.0.0
File Interpreter ABI Platform
audience_framework-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.1 kB

Release files / audience_framework-1.0.0.tar.gz

Download URL audience_framework-1.0.0.tar.gz
Size 10.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d9ff9f08ed12fa5138ecaf81617d2a3edcad5e700e76c3cff5be1a58ef19d69f
BLAKE2b-256 checksum
How to use checksums
773871f84f72e85aa7ef7cf6188c1ff4bda4057b44585a0463d97ff84f514866
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / audience_framework-1.0.0-py3-none-any.whl

Download URL audience_framework-1.0.0-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a8e1a7e755a293aafc9cae2d2db447d8d02716fbfa4be73b400a1754197150c2
BLAKE2b-256 checksum
How to use checksums
3b092e337e82bda2384d0beb24e9c19c3f981b50831b4172cb72510402ed1f1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Security for audience-framework 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page