aiosfstream
===========
.. image:: https://badge.fury.io/py/aiosfstream.svg
:target: https://badge.fury.io/py/aiosfstream
:alt: PyPI package
.. image:: https://readthedocs.org/projects/aiosfstream/badge/?version=latest
:target: http://aiosfstream.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. image:: https://travis-ci.org/robertmrk/aiosfstream.svg?branch=develop
:target: https://travis-ci.org/robertmrk/aiosfstream
:alt: Build status
.. image:: https://coveralls.io/repos/github/robertmrk/aiosfstream/badge.svg
:target: https://coveralls.io/github/robertmrk/aiosfstream
:alt: Coverage
.. image:: https://img.shields.io/badge/License-MIT-yellow.svg
:target: https://opensource.org/licenses/MIT
:alt: MIT license
aiosfstream is a `Salesforce Streaming API <api_>`_ client for asyncio_. It can
be used to receive push notifications about changes on Salesforce objects or
notifications of general events sent through the `Streaming API <api_>`_.
For detailed guidance on how to work with `PushTopics <PushTopic_>`_ or how
to create `Generic Streaming Channels <GenericStreaming_>`_ please consult the
`Streaming API documentation <api_>`_.
For working with `Platform Events <PlatformEvents_>`_ or
`Change Data Capture events <ChangeDataCapture_>`_ check out the linked
documentation.
Features
--------
- Supported authentication types:
- using a username and password
- using a refresh token
- Subscribe to and receive messages on:
- `PushTopics <PushTopic_>`_
- `Generic Streaming Channels <GenericStreaming_>`_
- `Platform Events <PlatformEvents_>`_
- `Change Data Capture events <ChangeDataCapture_>`_
- Support for `durable messages and replay of events <replay_>`_
- Automatic recovery from replay errors
Usage
-----
.. code-block:: python
import asyncio
from aiosfstream import SalesforceStreamingClient
async def stream_events():
# connect to Streaming API
async with SalesforceStreamingClient(
consumer_key="<consumer key>",
consumer_secret="<consumer secret>",
username="<username>",
password="<password>") as client:
# subscribe to topics
await client.subscribe("/topic/one")
await client.subscribe("/topic/two")
# listen for incoming messages
async for message in client:
topic = message["channel"]
data = message["data"]
print(f"{topic}: {data}")
if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(stream_events())
Documentation
-------------
http://aiosfstream.readthedocs.io/
.. _aiohttp: https://github.com/aio-libs/aiohttp/
.. _asyncio: https://docs.python.org/3/library/asyncio.html
.. _api: https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/intro_stream.htm
.. _PushTopic: https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/working_with_pushtopics.htm
.. _GenericStreaming: https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/generic_streaming_intro.htm#generic_streaming_intro
.. _replay: https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/using_streaming_api_durability.htm
.. _PlatformEvents: https://developer.salesforce.com/docs/atlas.en-us.platform_events.meta/platform_events/platform_events_intro.htm
.. _ChangeDataCapture: https://developer.salesforce.com/docs/atlas.en-us.change_data_capture.meta/change_data_capture/cdc_intro.htm
Changelog
=========
0.5.0 (2019-03-08)
------------------
- Add support for Change Data Capture events
- Fix some typos in the documentation
0.4.0 (2019-01-06)
------------------
- Add type hints
- Configurable replay storage behavior
0.3.0 (2018-11-07)
------------------
- Add support for sandbox orgs
0.2.5 (2018-11-06)
------------------
- Add missing changelog entries
0.2.4 (2018-11-06)
------------------
- Fix platform event message creation date extraction issue
0.2.3 (2018-09-19)
------------------
- Fix asynchronous iterator bug in python 3.7
0.2.2 (2018-06-15)
------------------
- Update aiocometd dependency to 0.3.1
0.2.1 (2018-05-25)
------------------
- Fix replay issues on mass record delete operations
- Improve the documentation of the Client.publish method
0.2.0 (2018-05-05)
------------------
- Enable the usage of third party JSON libraries
- Expose authentication results as public attributes in Authenticator classes
0.1.0 (2018-04-26)
------------------
- Supported authentication types:
- using a username and password
- using a refresh token
- Subscribe to and receive messages on:
- `PushTopics <PushTopic_>`_
- `Generic Streaming Channels <GenericStreaming_>`_
- Support for `durable messages and replay of events <replay_>`_
- Automatic recovery from replay errors
.. _aiohttp: https://github.com/aio-libs/aiohttp/
.. _asyncio: https://docs.python.org/3/library/asyncio.html
.. _api: https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/intro_stream.htm
.. _PushTopic: https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/working_with_pushtopics.htm
.. _GenericStreaming: https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/generic_streaming_intro.htm#generic_streaming_intro
.. _replay: https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/using_streaming_api_durability.htm
Raw data
{
"_id": null,
"home_page": "https://github.com/bensnyde/aiosfstream-ng",
"name": "aiosfstream-ng",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10.0",
"maintainer_email": "",
"keywords": "salesforce asyncio aiohttp comet cometd bayeux push streaming",
"author": "Benton Snyder",
"author_email": "benton@bensnyde.me",
"download_url": "https://files.pythonhosted.org/packages/b4/dd/dcf5a16177648410a1a8c7b29453c83569bf46b1ed9902ca03068d80c831/aiosfstream-ng-0.7.5.tar.gz",
"platform": null,
"description": "aiosfstream\r\n===========\r\n\r\n.. image:: https://badge.fury.io/py/aiosfstream.svg\r\n :target: https://badge.fury.io/py/aiosfstream\r\n :alt: PyPI package\r\n\r\n.. image:: https://readthedocs.org/projects/aiosfstream/badge/?version=latest\r\n :target: http://aiosfstream.readthedocs.io/en/latest/?badge=latest\r\n :alt: Documentation Status\r\n\r\n.. image:: https://travis-ci.org/robertmrk/aiosfstream.svg?branch=develop\r\n :target: https://travis-ci.org/robertmrk/aiosfstream\r\n :alt: Build status\r\n\r\n.. image:: https://coveralls.io/repos/github/robertmrk/aiosfstream/badge.svg\r\n :target: https://coveralls.io/github/robertmrk/aiosfstream\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\naiosfstream is a `Salesforce Streaming API <api_>`_ client for asyncio_. It can\r\nbe used to receive push notifications about changes on Salesforce objects or\r\nnotifications of general events sent through the `Streaming API <api_>`_.\r\n\r\nFor detailed guidance on how to work with `PushTopics <PushTopic_>`_ or how\r\nto create `Generic Streaming Channels <GenericStreaming_>`_ please consult the\r\n`Streaming API documentation <api_>`_.\r\nFor working with `Platform Events <PlatformEvents_>`_ or\r\n`Change Data Capture events <ChangeDataCapture_>`_ check out the linked\r\ndocumentation.\r\n\r\nFeatures\r\n--------\r\n\r\n- Supported authentication types:\r\n - using a username and password\r\n - using a refresh token\r\n- Subscribe to and receive messages on:\r\n - `PushTopics <PushTopic_>`_\r\n - `Generic Streaming Channels <GenericStreaming_>`_\r\n - `Platform Events <PlatformEvents_>`_\r\n - `Change Data Capture events <ChangeDataCapture_>`_\r\n- Support for `durable messages and replay of events <replay_>`_\r\n- Automatic recovery from replay errors\r\n\r\nUsage\r\n-----\r\n\r\n.. code-block:: python\r\n\r\n import asyncio\r\n\r\n from aiosfstream import SalesforceStreamingClient\r\n\r\n\r\n async def stream_events():\r\n # connect to Streaming API\r\n async with SalesforceStreamingClient(\r\n consumer_key=\"<consumer key>\",\r\n consumer_secret=\"<consumer secret>\",\r\n username=\"<username>\",\r\n password=\"<password>\") as client:\r\n\r\n # subscribe to topics\r\n await client.subscribe(\"/topic/one\")\r\n await client.subscribe(\"/topic/two\")\r\n\r\n # listen for incoming messages\r\n async for message in client:\r\n topic = message[\"channel\"]\r\n data = message[\"data\"]\r\n print(f\"{topic}: {data}\")\r\n\r\n if __name__ == \"__main__\":\r\n loop = asyncio.get_event_loop()\r\n loop.run_until_complete(stream_events())\r\n\r\nDocumentation\r\n-------------\r\n\r\nhttp://aiosfstream.readthedocs.io/\r\n\r\n.. _aiohttp: https://github.com/aio-libs/aiohttp/\r\n.. _asyncio: https://docs.python.org/3/library/asyncio.html\r\n.. _api: https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/intro_stream.htm\r\n.. _PushTopic: https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/working_with_pushtopics.htm\r\n.. _GenericStreaming: https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/generic_streaming_intro.htm#generic_streaming_intro\r\n.. _replay: https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/using_streaming_api_durability.htm\r\n.. _PlatformEvents: https://developer.salesforce.com/docs/atlas.en-us.platform_events.meta/platform_events/platform_events_intro.htm\r\n.. _ChangeDataCapture: https://developer.salesforce.com/docs/atlas.en-us.change_data_capture.meta/change_data_capture/cdc_intro.htm\r\n\r\nChangelog\r\n=========\r\n\r\n0.5.0 (2019-03-08)\r\n------------------\r\n\r\n- Add support for Change Data Capture events\r\n- Fix some typos in the documentation\r\n\r\n0.4.0 (2019-01-06)\r\n------------------\r\n\r\n- Add type hints\r\n- Configurable replay storage behavior\r\n\r\n0.3.0 (2018-11-07)\r\n------------------\r\n\r\n- Add support for sandbox orgs\r\n\r\n0.2.5 (2018-11-06)\r\n------------------\r\n\r\n- Add missing changelog entries\r\n\r\n0.2.4 (2018-11-06)\r\n------------------\r\n\r\n- Fix platform event message creation date extraction issue\r\n\r\n0.2.3 (2018-09-19)\r\n------------------\r\n\r\n- Fix asynchronous iterator bug in python 3.7\r\n\r\n0.2.2 (2018-06-15)\r\n------------------\r\n\r\n- Update aiocometd dependency to 0.3.1\r\n\r\n0.2.1 (2018-05-25)\r\n------------------\r\n\r\n- Fix replay issues on mass record delete operations\r\n- Improve the documentation of the Client.publish method\r\n\r\n0.2.0 (2018-05-05)\r\n------------------\r\n\r\n- Enable the usage of third party JSON libraries\r\n- Expose authentication results as public attributes in Authenticator classes\r\n\r\n0.1.0 (2018-04-26)\r\n------------------\r\n\r\n- Supported authentication types:\r\n - using a username and password\r\n - using a refresh token\r\n- Subscribe to and receive messages on:\r\n - `PushTopics <PushTopic_>`_\r\n - `Generic Streaming Channels <GenericStreaming_>`_\r\n- Support for `durable messages and replay of events <replay_>`_\r\n- Automatic recovery from replay errors\r\n\r\n.. _aiohttp: https://github.com/aio-libs/aiohttp/\r\n.. _asyncio: https://docs.python.org/3/library/asyncio.html\r\n.. _api: https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/intro_stream.htm\r\n.. _PushTopic: https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/working_with_pushtopics.htm\r\n.. _GenericStreaming: https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/generic_streaming_intro.htm#generic_streaming_intro\r\n.. _replay: https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/using_streaming_api_durability.htm\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Salesforce Streaming API client for asyncio",
"version": "0.7.5",
"project_urls": {
"CI": "https://travis-ci.org/robertmrk/aiosfstream",
"Coverage": "https://coveralls.io/github/robertmrk/aiosfstream",
"Docs": "http://aiosfstream.readthedocs.io/",
"Homepage": "https://github.com/bensnyde/aiosfstream-ng"
},
"split_keywords": [
"salesforce",
"asyncio",
"aiohttp",
"comet",
"cometd",
"bayeux",
"push",
"streaming"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "83bec92c69bfe3d20cd16686f4fbb96bee76e3633d7adfc7b0f238fdc85ea452",
"md5": "662c072194b0785feef78049d8013752",
"sha256": "9c9cfe6762609da2cbbbe8de1b86738aab3898055b5dc5c01d4efcfad719fedc"
},
"downloads": -1,
"filename": "aiosfstream_ng-0.7.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "662c072194b0785feef78049d8013752",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10.0",
"size": 16483,
"upload_time": "2024-02-20T13:01:44",
"upload_time_iso_8601": "2024-02-20T13:01:44.609633Z",
"url": "https://files.pythonhosted.org/packages/83/be/c92c69bfe3d20cd16686f4fbb96bee76e3633d7adfc7b0f238fdc85ea452/aiosfstream_ng-0.7.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "b4dddcf5a16177648410a1a8c7b29453c83569bf46b1ed9902ca03068d80c831",
"md5": "54596e5a522fe8cc039a286f995cf6bf",
"sha256": "b89983d99cce992c65771023ece8c7a6dc0e6938eab38ee8b3ace2fae974866f"
},
"downloads": -1,
"filename": "aiosfstream-ng-0.7.5.tar.gz",
"has_sig": false,
"md5_digest": "54596e5a522fe8cc039a286f995cf6bf",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10.0",
"size": 64395,
"upload_time": "2024-02-20T13:01:46",
"upload_time_iso_8601": "2024-02-20T13:01:46.102213Z",
"url": "https://files.pythonhosted.org/packages/b4/dd/dcf5a16177648410a1a8c7b29453c83569bf46b1ed9902ca03068d80c831/aiosfstream-ng-0.7.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-20 13:01:46",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "bensnyde",
"github_project": "aiosfstream-ng",
"travis_ci": true,
"coveralls": false,
"github_actions": false,
"tox": true,
"lcname": "aiosfstream-ng"
}