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. For working with Platform Events or Change Data Capture events check out the linked 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())

Documentation

http://aiosfstream.readthedocs.io/

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)

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-ng-0.6.0.tar.gz (64.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aiosfstream_ng-0.6.0-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file aiosfstream-ng-0.6.0.tar.gz.

File metadata

  • Download URL: aiosfstream-ng-0.6.0.tar.gz
  • Upload date:
  • Size: 64.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for aiosfstream-ng-0.6.0.tar.gz
Algorithm Hash digest
SHA256 5c7834b058de68f5dcf6b2f50abd72dd7493cd70b630c4a05e931d2876a36093
MD5 c7b9cfdd377285bf78f0caafee410ea9
BLAKE2b-256 1514090d0013b641c158a1fe2c4bdf7359601a667d01ca7417a115e4c1ce95d4

See more details on using hashes here.

File details

Details for the file aiosfstream_ng-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: aiosfstream_ng-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for aiosfstream_ng-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5c45629739bc8e0e6b1c9b1fd8845f6711af2bdf54be25054509cb48069649a5
MD5 161cd4591e77e9d602a619959b2cfd07
BLAKE2b-256 fac5d095c863ee8337fd113e74f2fd62c7e941d600f9b6afb7b700c43eae4fce

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