Skip to main content

aio_sf_streaming is a simple Python 3.6 asyncio library allowing to connect and receive live notifications from Salesforce.

Project description


Last release Documentation Status Build Coverage Maintainability Requirements Status MIT license

aio-sf-streaming is a simple Python 3.6 asyncio library allowing to connect and receive live notifications from Salesforce. This library is provided to you by papernest.

See The streaming API developer guide for more information about the different uses cases and how configure your Salesforce organization.


  • asyncio compatible library
  • Authentication with username/password or refresh token
  • Subscribe to push topics and custom events
  • Receive events pushed by Salesforce
  • Auto-reconnect after too many time of inactivity
  • Replay support: replay events missed while your client is disconnected (see documentation for more information).

aio-sf-streaming only support Python 3.6.

Getting started

Simple use case:

import asyncio
from aio_sf_streaming import SimpleSalesforceStreaming

async def print_event():
    # Create client and connect
    async with SimpleSalesforceStreaming(
                    client_secret='my-client-secret') as client:
        # Subscribe to some push topics
        await client.subscribe('/topic/Foo')
        await client.subscribe('/topic/Bar')
        async for message in
            # client will wait indefinitely, you can ask to exit
            if message['channel'] == '/topic/Bar':
                # You can unsubscribe when you want, too
                await client.unsubscribe('/topic/Foo')

loop = asyncio.get_event_loop()


Simply use pip:

$ pip install aio-sf-streaming


The library work well for our use-case then we does not plan a lot of new features.


If you find any problem, feel free to fill an issue. Pull-Request are also welcomed.

You can install development dependencies with:

$ pip install -e .[tests,docs]

Release history

  • v. 0.3.0: Remove date-time parsing of the replay mixin, allow client to customize ReSubscribeMixin retry conditions, allow retry conditions to extend duration.
  • v. 0.2.0: Add refresh token authentication
  • v. 0.1.1: Add documentation and initial typing information.
  • v. 0.1.0: Initial release.


aio-sf-streaming is offered under the MIT license.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for aio-sf-streaming, version 0.3.7
Filename, size File type Python version Upload date Hashes
Filename, size aio_sf_streaming-0.3.7-py3-none-any.whl (25.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size aio_sf_streaming-0.3.7.tar.gz (23.2 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page