Skip to main content

signalflow-client-python

PyPI - Version PyPI - Python Version


Table of Contents

SignalFlow is the SignalFx real-time analytics computation language. The SignalFlow API allows SignalFx users to execute real-time streaming analytics computations on the SignalFx platform. For more information, see the Splunk Observability Cloud developer documentation:

The SignalFlow Python library is a client that opens a connection to SignalFx, allowing you to execute SignalFlow programs against the back end and then stream data back to the client.

The following SignalFlow program returns the current number of users in your organization:

data('sf.org.num.orguser').publish()

Installation

To install the SignalFlow Python client library, open a terminal and run the following command:

pip install signalflow-client-python

Run a SignalFlow computation

The following example allows you run a SignalFlow computation from the command line. For additional examples, see the examples directory.

  1. Install the signalflow-client-python package:

    pip install signalflow-client-python
    
  2. Create a .py file that includes the following content:

#!/usr/bin/env python

import argparse

from signalfx.signalflow import SignalFlowClient


def main():
    parser = argparse.ArgumentParser(
        description="SignalFx SignalFlow streaming analytics demo"
    )
    parser.add_argument(
        "--stream-endpoint",
        help="SignalFx SignalFlow stream API endpoint",
        default="https://stream.signalfx.com",
    )
    parser.add_argument("token", help="Your SignalFx API access token")
    parser.add_argument("program", help="SignalFlow program to execute")
    options = parser.parse_args()
    client = SignalFlowClient(
        token=options.token,
        endpoint=options.stream_endpoint,
    )
    try:
        # Execute the computation and iterate over the message stream
        print("Requesting computation: {0}".format(options.program))
        c = client.execute(options.program)
        print("Waiting for data...")
        for msg in c.stream():
            print(f"Message: {msg}")
    except KeyboardInterrupt:
        print("Detaching from computation...")
    finally:
        client.close()
    print("Done.")


if __name__ == "__main__":
    main()
  1. Run the Python script, specifying values for the streaming endpoint (optional), the API access token, and the SignalFlow program.

    For example:

    python <file-name>.py --stream-endpoint https://stream.us0.signalfx.com <api-token> "data('sf.org.num.orguser').publish()"
    

TLS certificates

The default WebSocket transport requires an https:// or wss:// endpoint. It checks the server's certificate chain and hostname before sending your token. The client uses the CA bundle from certifi by default. Keep certifi up to date to receive changes to the trusted certificate authorities.

For a private deployment, pass the path to a PEM CA bundle with ca_certs:

client = SignalFlowClient(
    token=api_token,
    endpoint="https://stream.example.com",
    ca_certs="/path/to/ca-bundle.pem",
)

This bundle replaces the default CA bundle. Include any public CA certificates that the deployment also needs. The client requires certificate and hostname checks with either bundle, including when it reconnects. The ca_certs option also works with the Server-Sent Events transport. Custom transport factories must accept this keyword when the caller supplies it.

License

signalflow-client-python is distributed under the terms of the Apache-2.0 license.

Metadata

Release files for signalflow-client-python 1.3.10

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

Source distribution (sdist)

Source distribution for signalflow-client-python 1.3.10
File Size Uploaded Provenance Actions
signalflow_client_python-1.3.10.tar.gz 21.5 kB Without provenance Details for signalflow_client_python-1.3.10.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for signalflow-client-python 1.3.10
File Interpreter ABI Platform Actions
signalflow_client_python-1.3.10-py3-none-any.whl Python 3 none any Details for signalflow_client_python-1.3.10-py3-none-any.whl

Total release size: 42.9 kB

Release files / signalflow_client_python-1.3.10.tar.gz

Download URL signalflow_client_python-1.3.10.tar.gz
Size 21.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f74a3c7d34bef4c73840a9c5e11c7ef4d6585bc3e9dabfb50659eb15ceee2171
BLAKE2b-256 checksum
How to use checksums
3f4e320d1c47bc1e68547489e1d7e374c4be50bfc8dcdbb2b1a2f09fd8042aec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.18.1 {"ci":true,"cpu":"x86_64","distro":{"id":"jammy","libc":{"lib":"glibc","version":"2.35"},"name":"Ubuntu","version":"22.04"},"implementation":{"name":"CPython","version":"3.11.17"},"installer":{"name":"hatch","version":"1.18.1"},"openssl_version":"OpenSSL 3.0.2 15 Mar 2022","python":"3.11.17","system":{"name":"Linux","release":"6.8.0-1065-aws"}} HTTPX2/2.16.0

Release files / signalflow_client_python-1.3.10-py3-none-any.whl

Download URL signalflow_client_python-1.3.10-py3-none-any.whl
Size 21.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
876619f38e02c066424c0476ee0d657a7f376710a6c0e06b9b150c94a1a41f7b
BLAKE2b-256 checksum
How to use checksums
1721548e20ea40fcac2327ccd2ed75e3089850abee11305887485e8b3bee00e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.18.1 {"ci":true,"cpu":"x86_64","distro":{"id":"jammy","libc":{"lib":"glibc","version":"2.35"},"name":"Ubuntu","version":"22.04"},"implementation":{"name":"CPython","version":"3.11.17"},"installer":{"name":"hatch","version":"1.18.1"},"openssl_version":"OpenSSL 3.0.2 15 Mar 2022","python":"3.11.17","system":{"name":"Linux","release":"6.8.0-1065-aws"}} HTTPX2/2.16.0

Security for signalflow-client-python 1.3.10

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