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.1-cp310-abi3-win_amd64.whl (3.4 MB view details)

Uploaded CPython 3.10+Windows x86-64

nominal_streaming-0.9.1-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.1-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.1-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.1-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.1-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.1-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.1-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.1-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for nominal_streaming-0.9.1-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 21b4d5853c845551e7509c34b3c675ffc24f0bedf3a816448afb86de28781fc9
MD5 4d9c19a2242b2dc0caf654c99b5abadc
BLAKE2b-256 ce79021c39ecfd931d8104d7f5cc4162407f938cee55cbe42ace63de4a63f31d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.9.1-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 45b21c91de7ab5ac4f5539069ec458d5e68bd63341a6a1a6ce2052eea3522823
MD5 f963c0c791b4c95d65a7831ea3a131e9
BLAKE2b-256 17684af3b0b7e8aa821912e9486b465dfc2e55927dfb01bfe53cf9dc65c871d4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.9.1-cp310-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 d99aa6d6f36828ec6d346efc1f6f72e78d8fd4f1c5d1b00da292ab7804fe3667
MD5 8832f9452d73ad9cc81a8658906012df
BLAKE2b-256 bb6b7f75dfd8d5e28450c426d1954f64044750096955171ee7d4cffe9a00d1b3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.9.1-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 b3b029a1dfadbb278e3483cc69f8db07b65a49845b70b52b81d4bd106993ed11
MD5 2992ffb6d195cc0a790d67731a9aa3ec
BLAKE2b-256 54ec61cc6d6a9d60966d32024ba8625d72cc5aa8104a0871bfab33f47ce02173

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.9.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 09b68af87b1fe02470e41512188ebbb73b14c602ff5f2b674d525f86585a7f0f
MD5 c954dd1ac22e3253e30be662b275c314
BLAKE2b-256 7260cfd26cc8d5e3f44f20334fa114a49a20aa90b1f07127718ef44587c3ed4d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.9.1-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 509b73f1b04ed55b039f2a9c4ce55e5abe03f6d694af5ec0d641d9b2417547a9
MD5 a7ddf0d10f908727c5dd1f3d6e63555e
BLAKE2b-256 ab07b56202880d9a5a92d47501ef8fe369dbfd0a34604e0d5ea38ff5914a6f57

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.9.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0e59831ff2ffb556d91dd5799101d72525441082559f9b68da9d5dc328b218ca
MD5 1fb33b2fd8e19a3095543aa333b48321
BLAKE2b-256 ab49c687897bb7c856a29c57a84e1d9ccae003eac677f335a5b3a89565d2700d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.9.1-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bc3dddb6924b9a2a6c6fd92477b77aff4c86072ea8cac3d258f1fead71227c31
MD5 8dbe3ee2e8e73e1c090a2c5c48796ab8
BLAKE2b-256 da6856f9863de2950a2f53f8084531f621f8de1726757f1f9995615daf61736b

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