Skip to main content

A WebSub hub, publisher and subscriber using Flask

Project description

Flask-WebSub

An implementation of a WebSub hub, publisher and subscriber as a Flask extension. The implementation is meant to be used as a library that can be integrated in a larger application.

The components are split up into multiple packages, so you don’t necessarily have to use all three. It is for example possible to use the subscriber implementation with an external hub. To learn to use this package, take a look at the client_example.py (subscriber) and server_example.py (hub/publisher) files. Next to that, the public classes and functions of the package all have doc strings which can be inspected using the built-in python help() function.

If you do use both the publisher and hub package in the same app, you benefit from autodiscovery of the hub url.

Using the flask_websub.hub package requires celery.

For more about WebSub, see its specification: https://www.w3.org/TR/websub/

Examples

To run the examples, first setup a celery broker. I myself did it this way:

` docker run -p 6379:6379 redis:alpine `

Then, it’s time to update server_example.py and client_example.py’s SERVER_NAME config variable. Simply set them to whatever hostname the server will have (it can just be localhost).

Finally, it’s time to start the applications. Each line in a different terminal:

` celery -A server_example.celery worker -l info ./server_example.py ./client_example.py `

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

Flask-WebSub-0.1.tar.gz (14.2 kB view details)

Uploaded Source

File details

Details for the file Flask-WebSub-0.1.tar.gz.

File metadata

  • Download URL: Flask-WebSub-0.1.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for Flask-WebSub-0.1.tar.gz
Algorithm Hash digest
SHA256 7974db453d434971ff6b306cbdff51a1f537606f5a10dde628234b777d8b7c3b
MD5 014a1a465b777e0b90afab93f069e23b
BLAKE2b-256 9c0104d631078b41077d789de6de316a33b7ba0539a62d793f1853dd22d1e0ca

See more details on using hashes here.

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