Skip to main content

Salesforce Streaming API client for asyncio

Project description

aiosfstream

PyPI package Documentation Status Build status Coverage MIT license

aiosfstream is a Salesforce Streaming 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.

For detailed guidance on how to work with PushTopics or how to create Generic Streaming Channels please consult the Streaming API documentation.

Features

Usage

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())

Changelog

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)

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

aiosfstream-0.3.0.tar.gz (59.0 kB view hashes)

Uploaded Source

Built Distribution

aiosfstream-0.3.0-py3-none-any.whl (13.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page