Skip to main content

sprockets.mixins.avro-publisher

AMQP Publishing Mixin for publishing a message as an Avro datum.

Version Downloads

Installation

sprockets.mixins.avro-publisher is available on the Python Package Index and can be installed via pip or easy_install:

pip install sprockets.mixins.avro-publisher

Requirements

  • sprockets.mixins.amqp>=3.0.0

  • fastavro>=0.10.1,<2.0.0

  • tornado>=6,<7

Example

This examples demonstrates the most basic usage of sprockets.mixins.avro-publisher

export AMQP_URL="amqp://user:password@rabbitmq_host:5672/%2f"
python my-example-app.py
from tornado import gen
from tornado import web
from sprockets.mixins import avro_publisher

def make_app(**settings):
    settings = {'avro_schema_uri_format': 'http://my-schema-repository/%(name)s.avsc'}
    application = web.Application(
        [
            web.url(r'/', RequestHandler),
        ], **settings)

    avro_publisher.install(application)
    return application

class RequestHandler(avro_publisher.PublishingMixin, web.RequestHandler):

    async def get(self, *args, **kwargs):
        body = {'request': self.request.path, 'args': args, 'kwargs': kwargs}
        await self.avro_amqp_publish(
            'exchange',
            'routing.key',
            'avro-schema-name'
            body)

if __name__ == "__main__":
    application = make_app()
    application.listen(8888)
    logging.basicConfig(level=logging.INFO)
    ioloop.IOLoop.current().start()

Source

sprockets.mixins.avro-publisher source is available on Github at https://github.com/sprockets/sprockets.mixins.avro-publisher

License

sprockets.mixins.avro-publisher is released under the 3-Clause BSD license.

Metadata

Release files for sprockets.mixins.avro-publisher 3.0.1

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

Source distribution (sdist)

Source distribution for sprockets.mixins.avro-publisher 3.0.1
File Size Uploaded Provenance
sprockets.mixins.avro-publisher-3.0.1.tar.gz 9.3 kB Without provenance Details

Release files / sprockets.mixins.avro-publisher-3.0.1.tar.gz

Download URL sprockets.mixins.avro-publisher-3.0.1.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
3e8c859932ea460ae982a1259ba8c9eb5bb3707df865f51375914d15c2d553a2
BLAKE2b-256 checksum
How to use checksums
e8429399b9e97e44bad3845bbf6df8d3b1de14b4c465b0a605aa5f5cdd25a3bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

Security for sprockets.mixins.avro-publisher 3.0.1

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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