Skip to main content

Python bindings for the Nominal Rust streaming client

Project description

nominal-streaming Python Bindings

nominal-streaming is a thin python wrapper around the existing nominal-streaming rust crate. Usage semantics remain largely the same, but with some slight alterations to allow for a more pythonic interface.

The library aims to balance three concerns:

  1. Data should exist in-memory only for a limited, configurable amount of time before it's sent to Core.
  2. Writes should fall back to disk if there are network failures.
  3. Backpressure should be applied to incoming requests when network throughput is saturated.

This library streams data to Nominal Core, to a file, or to Nominal Core with a file as backup (recommended to protect against network failures). It also provides configuration to manage the tradeoff between above listed concerns.

[!WARNING] This library is still under active development and may make breaking changes.

Usage example: streaming from memory to Nominal Core with file fallback

import pathlib
import time

from nominal.core import NominalClient
from nominal_streaming import NominalDatasetStream, PyNominalStreamOpts

if __name__ == "__main__":
    num_points = 100_000
    stream = (
        NominalDatasetStream(
            auth_header="<api key>",
            opts=PyNominalStreamOpts(),
        )
        .enable_logging("info") # can set debug, warn, etc.
        .with_core_consumer("<dataset rid>")
        .with_file_fallback(pathlib.Path("local_fallback.avro"))
    )

    with stream:
        # Stream 100_000 live readings (made up values)
        for idx in range(num_points):
            time_ns = int(time.time() * 1e9)
            value = (idx % 50) + 0.5
            stream.enqueue("channel_name", time_ns, value, tags={"tag_key": "tag_value"})

        # Stream 100_000 points in one batch
        start_time = int(time.time() * 1e9)
        timestamp_offsets = int(1e9 / 1600)
        timestamps = [start_time + timestamp_offsets * idx for idx in range(num_points)]
        values = [(idx % 50) + 0.5 for idx in range(num_points)]
        stream.enqueue_batch(
            "channel_name",
            timestamps,
            values,
            tags={"tag_key": "tag_value"}
        )

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

nominal_streaming-0.9.0-cp310-abi3-win_amd64.whl (3.4 MB view details)

Uploaded CPython 3.10+Windows x86-64

nominal_streaming-0.9.0-cp310-abi3-musllinux_1_2_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ x86-64

nominal_streaming-0.9.0-cp310-abi3-musllinux_1_2_armv7l.whl (3.5 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARMv7l

nominal_streaming-0.9.0-cp310-abi3-musllinux_1_2_aarch64.whl (3.7 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

nominal_streaming-0.9.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

nominal_streaming-0.9.0-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (3.2 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARMv7l

nominal_streaming-0.9.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.5 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

nominal_streaming-0.9.0-cp310-abi3-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

Details for the file nominal_streaming-0.9.0-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for nominal_streaming-0.9.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 5f6006c8e3a892de167e1d5f0ab9fb2da86dd42d4103623ff5eda111e78022f1
MD5 73b8594b03c9d2eaec890e1f09a1ad2f
BLAKE2b-256 303a3d680f677c518d710c257a92aff30f08ca8c450878a3c01b943d2ea2ede7

See more details on using hashes here.

File details

Details for the file nominal_streaming-0.9.0-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for nominal_streaming-0.9.0-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 f7d6f0c324f08bc995d80077e895c382e7c55433fc9570279269fc927d7b5d88
MD5 4c6deb399e1dcbdf04bc434d6b3b5a59
BLAKE2b-256 963844c62d8f77eb7621f0f20bc3959537d564cd4dce09e06f8cc4df73ccad3b

See more details on using hashes here.

File details

Details for the file nominal_streaming-0.9.0-cp310-abi3-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for nominal_streaming-0.9.0-cp310-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 758d743112917208fa0acb909ad64a6a4fd4cc92040521a28b3482981a38e761
MD5 fe06f8d585c318a35a9598b181ac4108
BLAKE2b-256 b9935cfec083d048f9b1c38afcfc5b26f051f5110d2fe1aa9df9423c1fb1555d

See more details on using hashes here.

File details

Details for the file nominal_streaming-0.9.0-cp310-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for nominal_streaming-0.9.0-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 98cb26a626a71a92015594641691dbcf9f309fd4d4d8b98b956973b408e50a6f
MD5 fc9dc22aaea90d42f7d8ff09166738da
BLAKE2b-256 b7c16d22d84643bf96d13408121ec50376923a3640d378aac2ef3b1a07cbe25e

See more details on using hashes here.

File details

Details for the file nominal_streaming-0.9.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for nominal_streaming-0.9.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 373e3ddac4090f0f85f20b5e0f948ae7a13c562acae34d3b0fdce2b3f2d9ddb7
MD5 cb90c33f1d66bb95b1e1781357170200
BLAKE2b-256 36455c3f96d878c75c6fa3d60cbecb683d19a90a43c5f9429d73093ad1f38c9c

See more details on using hashes here.

File details

Details for the file nominal_streaming-0.9.0-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for nominal_streaming-0.9.0-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 2a357dc57a1c6c4b502efe4ede17c5a4adb8fded10c9743e7109e1b4b28d0fe1
MD5 987b8fa1107d7d7cd0fa6c02504c89b7
BLAKE2b-256 f1af83f1fc2fce6014545145f075a08409ea9ba980f7f34485277b8cd0c9f2da

See more details on using hashes here.

File details

Details for the file nominal_streaming-0.9.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for nominal_streaming-0.9.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a8eab17ad44496f001ae74344c35373d83edd1fc9128ac96f6a7b13747c73a53
MD5 4df8f7842ff2795589d80f1a3dd79b9b
BLAKE2b-256 aa581d2be383b22b296ebcf7d6b48cf02e8b1cc0ffd81caad0ce43bf3504f6d5

See more details on using hashes here.

File details

Details for the file nominal_streaming-0.9.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for nominal_streaming-0.9.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6270b006e4ee5db3339c65e4c123dd9efbe0c34c26f06187e64355908730df66
MD5 57a52b49a4c4b75e6285d18adcf17884
BLAKE2b-256 d9b0e631a4c1036dc94064278e23fc8de59e4adbbc47b4eec4c8d1ab7cbf4122

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