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

[!TIP] The SignalFx UI uses the SignalFlow language to produce charts, graphs, and alerts. You can reuse SignalFlow programs from the UI in the code that you write using the SignalFlow Python client library.

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

License

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

Release files for signalflow-client-python 1.3.9

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.9
File Size Uploaded
signalflow_client_python-1.3.9.tar.gz 18.1 kB Details

Built distribution (wheel)

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

Total release size: 38.6 kB

Release files / signalflow_client_python-1.3.9.tar.gz

Download URL signalflow_client_python-1.3.9.tar.gz
Size 18.1 kB
Tags Source
SHA-256 checksum
How to use checksums
99b1faf24411743c4140142baf39138910dc8e9e6928e78ff2ede412a1e2728b
BLAKE2b-256 checksum
How to use checksums
6b1ed87ecb595b6e63d55a2780b6a325b545d02344d2625feda89b8f8425f0d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.17.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.15"},"installer":{"name":"hatch","version":"1.17.1"},"openssl_version":"OpenSSL 3.0.2 15 Mar 2022","python":"3.11.15","system":{"name":"Linux","release":"5.15.0-1084-aws"}} HTTPX2/2.5.0

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

Download URL signalflow_client_python-1.3.9-py3-none-any.whl
Size 20.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
065198efc2bb4c5419307c2af205031bf9b3a3b3e09f06724c696517e5fe0eee
BLAKE2b-256 checksum
How to use checksums
7b846e208a395b6925e71e64b63af87f62e9416637cbe416969019a41158c684
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.17.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.15"},"installer":{"name":"hatch","version":"1.17.1"},"openssl_version":"OpenSSL 3.0.2 15 Mar 2022","python":"3.11.15","system":{"name":"Linux","release":"5.15.0-1084-aws"}} HTTPX2/2.5.0

Release history Release notifications | RSS feed

This release

1.3.9 This release

2 release files

1.3.8

2 release files

1.3.7

2 release files

1.3.6

2 release files

1.3.5

2 release files

1.3.4

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

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