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

Uploaded CPython 3.10+Windows x86-64

nominal_streaming-0.7.7-cp310-abi3-musllinux_1_2_x86_64.whl (3.7 MB view details)

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

nominal_streaming-0.7.7-cp310-abi3-musllinux_1_2_armv7l.whl (3.2 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARMv7l

nominal_streaming-0.7.7-cp310-abi3-musllinux_1_2_aarch64.whl (3.5 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

nominal_streaming-0.7.7-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.6 MB view details)

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

nominal_streaming-0.7.7-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (3.0 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARMv7l

nominal_streaming-0.7.7-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.3 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

nominal_streaming-0.7.7-cp310-abi3-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.7-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 beafa38fc4ceac33b005ab1df6cf20541800920d9eb269fb6a63eff137625600
MD5 900c8354e1dede3ab986f6dc0f2da55b
BLAKE2b-256 01e2c014838d390c838cb8b307a4db5e24a0fe49f72a38a317e4cb6831bcd2b8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.7-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 afd51eb1ab81b381f05328011868305b8a7a3991e51b9d4cea4814c580881f6d
MD5 a5f5db04610f4aa7bdf0aedfc6f406de
BLAKE2b-256 3ae5f624e0384f31481dd26a7fc0494b4bcf6542d5b7d6772c29c9bd408c3f1f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.7-cp310-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 4b0f99609cd09a9505487adec1f09fdabfd4a8d78036ec8b708a79015ad64a3b
MD5 4593adabe5f51966877c30974e21f083
BLAKE2b-256 a3651945016e8083acb41b3bfcd42595dc5609785cbe09b6a9c405b9cb9f8751

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.7-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 df1012dc6ba7d42ce87aaee56d60192b5ffca4abb990e0a82f9bb761b82ccb0d
MD5 53120d00c8d016187e08dcd0a55f0da2
BLAKE2b-256 389b40d298216861118a07451e9d378b99d111e1cdc3ff4fee5b4a27256d924b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.7-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4350c40f85603e9b312d7723b2379af8d205a764f5ef4261386cde58f90d0537
MD5 e0b3c397320931e22ce5a5d72259a4e5
BLAKE2b-256 7ea8dded1bf83c8f32472700ce7b23b8beaccb425320bcadfc3348389730c2ad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.7-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 68ed9f26cba41479519e8a80d7703f8acd85045f0fcfc945c255454c2e291d14
MD5 37dbe12cb31b8d24b6b8258c717c4ca2
BLAKE2b-256 667073503f3944401e035b33e2fe02edb4171751d4d0b16f0c94e8750b95678a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.7-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1437c6b835639056be9cb509253bf343f2465868a03edf448bc2a66c2400320a
MD5 71371bf5b9bb5a6c3502f5685f1cb2bc
BLAKE2b-256 980b40fc5809915c2d93a9ca08db2228dcb5c73cb5b30e257a67704d8c54a711

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.7-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4e2aa50d79d4ca2f9b518a61ef191694ae31906220e6f0ea92e0b8c0bb6c5522
MD5 3883a922ee597819b21cac3270eeb849
BLAKE2b-256 2bc7fbbdc8feede8d2c72b161742086de43b6a041c1b668e7cabeb4620ef96ce

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