Skip to main content

aio-sf-streaming

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 Force.com streaming API developer guide for more information about the different uses cases and how configure your Salesforce organization.

Feature

  • 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 Force.com 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(
                    username='my-username',
                    password='my-password',
                    client_id='my-client-id',
                    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.events():
            print(message)
            # client will wait indefinitely, you can ask to exit
            if message['channel'] == '/topic/Bar':
                break
            else:
                # You can unsubscribe when you want, too
                await client.unsubscribe('/topic/Foo')

loop = asyncio.get_event_loop()
loop.run_until_complete(print_event())

Installation

Simply use pip:

$ pip install aio-sf-streaming

Documentation

An online documentation is available.

Evolution

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

Contributing

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.

License

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

Metadata

Release files for aio-sf-streaming 0.3.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aio-sf-streaming 0.3.7
File Size Uploaded Provenance Actions
aio_sf_streaming-0.3.7.tar.gz 23.2 kB Without provenance Details for aio_sf_streaming-0.3.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aio-sf-streaming 0.3.7
File Interpreter ABI Platform Actions
aio_sf_streaming-0.3.7-py3-none-any.whl Python 3 none any Details for aio_sf_streaming-0.3.7-py3-none-any.whl

Total release size: 48.4 kB

Release files / aio_sf_streaming-0.3.7.tar.gz

Download URL aio_sf_streaming-0.3.7.tar.gz
Size 23.2 kB
Tags Source
SHA-256 checksum
How to use checksums
86f9dada9425623871f0a669bb21c00aaed21181642b81b01824abb5206e492b
BLAKE2b-256 checksum
How to use checksums
450372d64b6fb51df2480476a42a90cc06ef82caa1a41f82cf66e78025640f28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0

Release files / aio_sf_streaming-0.3.7-py3-none-any.whl

Download URL aio_sf_streaming-0.3.7-py3-none-any.whl
Size 25.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a384526b815494b46b10a2d4320912a8441099f7127003dbd1fd152886d8a0e
BLAKE2b-256 checksum
How to use checksums
ac35531e5d77bda05c93d48200b46122873eac2c07b963d8efdde700a4dd7750
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0

Security for aio-sf-streaming 0.3.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page