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

Uploaded CPython 3.10+Windows x86-64

nominal_streaming-0.7.4-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.4-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.4-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.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.5 MB view details)

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

nominal_streaming-0.7.4-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.4-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.4-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.4-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for nominal_streaming-0.7.4-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 30e8c3b1fe84a96a0e61f43109cef014f0e467c68956a90b7043ae56d24414b2
MD5 dbfe3205de38ea13d29d2528536b3116
BLAKE2b-256 ba43aa6f7f04c1ed5b41b4b4eeb6ba388883f31b8ceb471b42630019868c64b7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.4-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 b50f93fa8dc125bbe64f81a961f138757099c7058baa4de147688c570faed74c
MD5 54cfad4331fc568d50562f4c1df61663
BLAKE2b-256 37f74c094ca06bfdd1a1d193511a712253fe872b06d3df1950fbc0fe03a6707e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.4-cp310-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 d3c8ddc8b9ffdc6b757140ce8b746f02d24fcc39d80a7ef795a227a882c8a82f
MD5 fc8f1051092a1ca58ab1251c47bc3c03
BLAKE2b-256 3b45fedf07ad8834b6161216400a150d7fcfb04ed360aa96b3e4f42ed6506485

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.4-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 b6a5f386da93052a8b7061ea0ffbc5937d6c8549a199808d48ef7faa6d9145de
MD5 67bd019a3d0ce904ead48abd6e8d193a
BLAKE2b-256 d91bda4e7616ed2512450e2179ed0b3962fde8bf39b403f7e0d778c1cee8aa28

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3ef3bfd6d329bfc02886f18e4a0f7875ed21380771fa5983d677ad52cdc58b58
MD5 ccca533b88ecebf4b07ee40786d13d4e
BLAKE2b-256 c1cf49c05a80c5204971ab1bb53bc4fb4dfc63d6add8dafe4e587844ccd53e58

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.4-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 7ba3d7168babdda5a2759a6ad34d76053ed5f06827e8f6c77a35d941123d6dcd
MD5 15751aad3c250ac7084f4cd9ccf6883b
BLAKE2b-256 6b9629ee064bde06b19b7e31a4c29ac8c177d82e8c5a0409f02744fde8a58786

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 bb3d533fbb9aede07fb856350ddc9c99ad69a935628defd0d491b009e01a768a
MD5 1edaf3701ec939ff86930b1cb673cba6
BLAKE2b-256 1cd724868dac31778913fde4df88a6e49860afe1c26472dc1dabab6b762d6574

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.4-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e577ac6d18f926df736227a5be59fa8a0d8bb003f771093ac3beb220d1a83224
MD5 00f79305afb9acf9550e443466c20ac1
BLAKE2b-256 1a381894ceacfb2952ebd67abcc323f8adfcbfac72a7f4deaee2f4ba96643dea

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