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

Uploaded CPython 3.10+Windows x86-64

nominal_streaming-0.8.2-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.8.2-cp310-abi3-musllinux_1_2_armv7l.whl (3.5 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARMv7l

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

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

nominal_streaming-0.8.2-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.8.2-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.8.2-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.8.2-cp310-abi3-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.8.2-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 4f857aca078b24c28e40a28178ed39bf71e685e11b7822954084bece1b5355d1
MD5 1a6e7c78fbbc2c247d65d032c5fa8e80
BLAKE2b-256 92c91ca3193ddc848ad46a6c2599a9dd937e3deb1eb0f7e9b5ac3a809058632f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.8.2-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 8ed2acfd893efa7ef7e05a19334280ef782b8f1356dbc6895cc2f6ca55ad8d01
MD5 7e50ce028c58fac02dc19ef6a704da4f
BLAKE2b-256 168d6d2a87e913d14a4fe3505362ffd43462b38eefeb330e9b84f409d5598940

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.8.2-cp310-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 043eeff479a8703468de42df3d402f3ba5577af14592542b9795f9a56d20ce4f
MD5 7fb7642135b3c64c040ea0d5a87c96b7
BLAKE2b-256 f67611432cab1657762dbd4521e4e7645c680c8253bd0f9bd6135b697cca43de

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.8.2-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 73bd1f409be625c4bbbb6980c1933dbc018ee4a7fc508c31b9ffbf05f56ec9cd
MD5 68b5f1b380fb48c5bad453e6834df737
BLAKE2b-256 11f81fb981538aa2dd88ae89fd61809faef78b7833e136892e25de4101cc25cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.8.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b2727876105101025d9756f38d2e6b2c01230dc13b764d2c96092564843b71b3
MD5 c06927bf36363addb67419f40867c4f2
BLAKE2b-256 ec510a534d20f3c039deb2c8cd3d1f14336cf4c083b1c1d2d3e64f0864256c39

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.8.2-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 9a1df9b143797f15786296d3f888eef5c7cedb5fbd0fcfa162fd7458e8d0362e
MD5 ae934b0cbf0261fd82dd77ddfe8a044d
BLAKE2b-256 bff4f19fee7eb20c09b9754b2c8ecc06631f2c7a324e99507a70e0892b8fb810

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.8.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4e08cea01afaba9895276f406e929468d43ca01546a36a15bf2354dd7ee3ca85
MD5 28d872854d4db1bcef5657b182c3bbf4
BLAKE2b-256 9664f648ca49608f1dbc35cc1d19f98949fab20b6851963a9bea3c69b51d6167

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.8.2-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 450332d91567759772c429d015c0a58dfd69775caf7a8fc1fd2e0f1969652700
MD5 49416610ce4ca6fa4b9572d3907509e9
BLAKE2b-256 c85b321690dcd301df005b447441627371fd7c918fd82b69bc76a7c50ed48060

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