aiocometd
=========
.. image:: https://badge.fury.io/py/aiocometd.svg
:target: https://badge.fury.io/py/aiocometd
:alt: PyPI package
.. image:: https://readthedocs.org/projects/aiocometd/badge/?version=latest
:target: http://aiocometd.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. image:: https://travis-ci.org/robertmrk/aiocometd.svg?branch=develop
:target: https://travis-ci.org/robertmrk/aiocometd
:alt: Build status
.. image:: https://coveralls.io/repos/github/robertmrk/aiocometd/badge.svg
:target: https://coveralls.io/github/robertmrk/aiocometd
:alt: Coverage
.. image:: https://img.shields.io/badge/License-MIT-yellow.svg
:target: https://opensource.org/licenses/MIT
:alt: MIT license
aiocometd is a CometD_ client built using asyncio_, implementing the Bayeux_
protocol.
CometD_ is a scalable WebSocket and HTTP based event and message routing bus.
CometD_ makes use of WebSocket and HTTP push technologies known as Comet_ to
provide low-latency data from the server to browsers and client applications.
Features
--------
- Supported transports:
- ``long-polling``
- ``websocket``
- Automatic reconnection after network failures
- Extensions
Usage
-----
.. code-block:: python
import asyncio
from aiocometd import Client
async def chat():
nickname = "John"
# connect to the server
async with Client("http://example.com/cometd") as client:
# subscribe to channels to receive chat messages and
# notifications about new members
await client.subscribe("/chat/demo")
await client.subscribe("/members/demo")
# send initial message
await client.publish("/chat/demo", {
"user": nickname,
"membership": "join",
"chat": nickname + " has joined"
})
# add the user to the chat room's members
await client.publish("/service/members", {
"user": nickname,
"room": "/chat/demo"
})
# listen for incoming messages
async for message in client:
if message["channel"] == "/chat/demo":
data = message["data"]
print(f"{data['user']}: {data['chat']}")
if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(chat())
For more detailed usage examples take a look at the
`command line chat example <cli_example_>`_ or for a more complex example with
a GUI check out the aiocometd-chat-demo_.
Documentation
-------------
https://aiocometd.readthedocs.io/
.. _aiohttp: https://github.com/aio-libs/aiohttp/
.. _CometD: https://cometd.org/
.. _Comet: https://en.wikipedia.org/wiki/Comet_(programming)
.. _asyncio: https://docs.python.org/3/library/asyncio.html
.. _Bayeux: https://docs.cometd.org/current/reference/#_bayeux
.. _ext: https://docs.cometd.org/current/reference/#_bayeux_ext
.. _cli_example: https://github.com/robertmrk/aiocometd/blob/develop/examples/chat.py
.. _aiocometd-chat-demo: https://github.com/robertmrk/aiocometd-chat-demo
Changelog
=========
0.4.5 (2019-03-14)
------------------
- Fix connection issues when used with reverse proxy servers with cookie based
sticky sessions
0.4.4 (2019-02-26)
------------------
- Refactor the websocket transport implementation to use a single connection
per client
0.4.3 (2019-02-12)
------------------
- Fix reconnection issue on Salesforce Streaming API
0.4.2 (2019-01-15)
------------------
- Fix the handling of invalid websocket transport responses
- Fix the handling of failed subscription responses
0.4.1 (2019-01-04)
------------------
- Add documentation links
0.4.0 (2019-01-04)
------------------
- Add type hints
- Add integration tests
0.3.1 (2018-06-15)
------------------
- Fix premature request timeout issue
0.3.0 (2018-05-04)
------------------
- Enable the usage of third party JSON libraries
- Fix detection and recovery from network failures
0.2.3 (2018-04-24)
------------------
- Fix RST rendering issues
0.2.2 (2018-04-24)
------------------
- Fix documentation typos
- Improve examples
- Reorganise documentation
0.2.1 (2018-04-21)
------------------
- Add PyPI badge to README
0.2.0 (2018-04-21)
------------------
- Supported transports:
- ``long-polling``
- ``websocket``
- Automatic reconnection after network failures
- Extensions
Raw data
{
"_id": null,
"home_page": "https://github.com/bensnyde/aiocometd-ng",
"name": "aiocometd-ng",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10.0",
"maintainer_email": null,
"keywords": "asyncio aiohttp comet cometd bayeux push streaming",
"author": "Benton Snyder",
"author_email": "benton@bensnyde.me",
"download_url": "https://files.pythonhosted.org/packages/1b/b3/5a04b02cfa27436caf1653df42cd56a7642ce3ccc7c4e8e4e49ddd25401a/aiocometd_ng-0.5.6.tar.gz",
"platform": null,
"description": "aiocometd\r\n=========\r\n\r\n.. image:: https://badge.fury.io/py/aiocometd.svg\r\n :target: https://badge.fury.io/py/aiocometd\r\n :alt: PyPI package\r\n\r\n.. image:: https://readthedocs.org/projects/aiocometd/badge/?version=latest\r\n :target: http://aiocometd.readthedocs.io/en/latest/?badge=latest\r\n :alt: Documentation Status\r\n\r\n.. image:: https://travis-ci.org/robertmrk/aiocometd.svg?branch=develop\r\n :target: https://travis-ci.org/robertmrk/aiocometd\r\n :alt: Build status\r\n\r\n.. image:: https://coveralls.io/repos/github/robertmrk/aiocometd/badge.svg\r\n :target: https://coveralls.io/github/robertmrk/aiocometd\r\n :alt: Coverage\r\n\r\n.. image:: https://img.shields.io/badge/License-MIT-yellow.svg\r\n :target: https://opensource.org/licenses/MIT\r\n :alt: MIT license\r\n\r\naiocometd is a CometD_ client built using asyncio_, implementing the Bayeux_\r\nprotocol.\r\n\r\nCometD_ is a scalable WebSocket and HTTP based event and message routing bus.\r\nCometD_ makes use of WebSocket and HTTP push technologies known as Comet_ to\r\nprovide low-latency data from the server to browsers and client applications.\r\n\r\nFeatures\r\n--------\r\n\r\n- Supported transports:\r\n - ``long-polling``\r\n - ``websocket``\r\n- Automatic reconnection after network failures\r\n- Extensions\r\n\r\nUsage\r\n-----\r\n\r\n.. code-block:: python\r\n\r\n import asyncio\r\n\r\n from aiocometd import Client\r\n\r\n async def chat():\r\n nickname = \"John\"\r\n\r\n # connect to the server\r\n async with Client(\"http://example.com/cometd\") as client:\r\n\r\n # subscribe to channels to receive chat messages and\r\n # notifications about new members\r\n await client.subscribe(\"/chat/demo\")\r\n await client.subscribe(\"/members/demo\")\r\n\r\n # send initial message\r\n await client.publish(\"/chat/demo\", {\r\n \"user\": nickname,\r\n \"membership\": \"join\",\r\n \"chat\": nickname + \" has joined\"\r\n })\r\n # add the user to the chat room's members\r\n await client.publish(\"/service/members\", {\r\n \"user\": nickname,\r\n \"room\": \"/chat/demo\"\r\n })\r\n\r\n # listen for incoming messages\r\n async for message in client:\r\n if message[\"channel\"] == \"/chat/demo\":\r\n data = message[\"data\"]\r\n print(f\"{data['user']}: {data['chat']}\")\r\n\r\n if __name__ == \"__main__\":\r\n loop = asyncio.get_event_loop()\r\n loop.run_until_complete(chat())\r\n\r\nFor more detailed usage examples take a look at the\r\n`command line chat example <cli_example_>`_ or for a more complex example with\r\na GUI check out the aiocometd-chat-demo_.\r\n\r\nDocumentation\r\n-------------\r\n\r\nhttps://aiocometd.readthedocs.io/\r\n\r\n.. _aiohttp: https://github.com/aio-libs/aiohttp/\r\n.. _CometD: https://cometd.org/\r\n.. _Comet: https://en.wikipedia.org/wiki/Comet_(programming)\r\n.. _asyncio: https://docs.python.org/3/library/asyncio.html\r\n.. _Bayeux: https://docs.cometd.org/current/reference/#_bayeux\r\n.. _ext: https://docs.cometd.org/current/reference/#_bayeux_ext\r\n.. _cli_example: https://github.com/robertmrk/aiocometd/blob/develop/examples/chat.py\r\n.. _aiocometd-chat-demo: https://github.com/robertmrk/aiocometd-chat-demo\r\n\r\nChangelog\r\n=========\r\n\r\n0.4.5 (2019-03-14)\r\n------------------\r\n\r\n- Fix connection issues when used with reverse proxy servers with cookie based\r\n sticky sessions\r\n\r\n0.4.4 (2019-02-26)\r\n------------------\r\n\r\n- Refactor the websocket transport implementation to use a single connection\r\n per client\r\n\r\n0.4.3 (2019-02-12)\r\n------------------\r\n\r\n- Fix reconnection issue on Salesforce Streaming API\r\n\r\n0.4.2 (2019-01-15)\r\n------------------\r\n\r\n- Fix the handling of invalid websocket transport responses\r\n- Fix the handling of failed subscription responses\r\n\r\n0.4.1 (2019-01-04)\r\n------------------\r\n\r\n- Add documentation links\r\n\r\n0.4.0 (2019-01-04)\r\n------------------\r\n\r\n- Add type hints\r\n- Add integration tests\r\n\r\n0.3.1 (2018-06-15)\r\n------------------\r\n\r\n- Fix premature request timeout issue\r\n\r\n0.3.0 (2018-05-04)\r\n------------------\r\n\r\n- Enable the usage of third party JSON libraries\r\n- Fix detection and recovery from network failures\r\n\r\n0.2.3 (2018-04-24)\r\n------------------\r\n\r\n- Fix RST rendering issues\r\n\r\n0.2.2 (2018-04-24)\r\n------------------\r\n\r\n- Fix documentation typos\r\n- Improve examples\r\n- Reorganise documentation\r\n\r\n0.2.1 (2018-04-21)\r\n------------------\r\n\r\n- Add PyPI badge to README\r\n\r\n0.2.0 (2018-04-21)\r\n------------------\r\n\r\n- Supported transports:\r\n - ``long-polling``\r\n - ``websocket``\r\n- Automatic reconnection after network failures\r\n- Extensions\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "CometD client for asyncio",
"version": "0.5.6",
"project_urls": {
"CI": "https://travis-ci.org/robertmrk/aiocometd",
"Coverage": "https://coveralls.io/github/robertmrk/aiocometd",
"Docs": "http://aiocometd.readthedocs.io/",
"Homepage": "https://github.com/bensnyde/aiocometd-ng"
},
"split_keywords": [
"asyncio",
"aiohttp",
"comet",
"cometd",
"bayeux",
"push",
"streaming"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d2c97bed4c13594591ed8fdf1c928b3a9b3845b881ced0d1db8e3f2d1b964ea1",
"md5": "a7b08a73c5678dedf5e32d3ccaf278b5",
"sha256": "6d6bf7c7c1f8ec3a5a487266a1203d671b34d576157c49554186acb517c1d85b"
},
"downloads": -1,
"filename": "aiocometd_ng-0.5.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a7b08a73c5678dedf5e32d3ccaf278b5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10.0",
"size": 28128,
"upload_time": "2024-06-17T12:16:17",
"upload_time_iso_8601": "2024-06-17T12:16:17.830329Z",
"url": "https://files.pythonhosted.org/packages/d2/c9/7bed4c13594591ed8fdf1c928b3a9b3845b881ced0d1db8e3f2d1b964ea1/aiocometd_ng-0.5.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1bb35a04b02cfa27436caf1653df42cd56a7642ce3ccc7c4e8e4e49ddd25401a",
"md5": "4ba39442ca70c9a0ba1d15ee73e2c28e",
"sha256": "c81037f0be56944f6ce0bf693e7b830ff84cfd379a9e9e9a5614f8b9f0931252"
},
"downloads": -1,
"filename": "aiocometd_ng-0.5.6.tar.gz",
"has_sig": false,
"md5_digest": "4ba39442ca70c9a0ba1d15ee73e2c28e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10.0",
"size": 56250,
"upload_time": "2024-06-17T12:16:19",
"upload_time_iso_8601": "2024-06-17T12:16:19.035684Z",
"url": "https://files.pythonhosted.org/packages/1b/b3/5a04b02cfa27436caf1653df42cd56a7642ce3ccc7c4e8e4e49ddd25401a/aiocometd_ng-0.5.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-17 12:16:19",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "bensnyde",
"github_project": "aiocometd-ng",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"tox": true,
"lcname": "aiocometd-ng"
}