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

Uploaded CPython 3.10+Windows x86-64

nominal_streaming-0.7.10-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.10-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.10-cp310-abi3-musllinux_1_2_aarch64.whl (3.4 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

nominal_streaming-0.7.10-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.10-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.10-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.10-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.10-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for nominal_streaming-0.7.10-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 7785430f092e125863870cb22d61dbca7fdec2d4855e7e223c9a6f18eb1eb471
MD5 c70e15df5d090c5ff9cf0dcc261f27c5
BLAKE2b-256 c1f632fa8bbe3bbb91f1ef9ad5ba14adbcad0d36840f806120552d38b500d422

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.10-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 52d34404cb7f61479e2eec69e3b675e1783a71b30f88de5ac0d5267371859888
MD5 872dc6d1417e19adb6a0f18146547bab
BLAKE2b-256 9ce18f04a34e928ad1d5051997c27a52b972ba855fd0489773d86d9715d276f5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.10-cp310-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 03c1b020d0047a162a46b5ada217f2ecade029f41a70cfa532b260586cecb0a9
MD5 ec144a2203c522d85575e4f8d1b92bc6
BLAKE2b-256 660afd6835763376b3bbfb6c46dea58bd937f238ee4ba0eb8ca069bcef4aa476

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.10-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 49c6484da60f0b7350c12bc914877ca7becbf5af7dd467aaeb671bd7602711a2
MD5 1ced85b4b6fdd14d8845dd828f86a201
BLAKE2b-256 e4d07f1a308c253c053e131816056123345569d340a599aa039295ef8dd46d8e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.10-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5282377c4f2eee371db573a84c03a901a4099bd02b46e2adef406c2d64ad45c4
MD5 f513638a7e1e5f7736860a99d1a97ec7
BLAKE2b-256 c06e8b47d5aca5ce49147e63a8b3b51eafac1620ca08e4c50d500ee61404f7cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.10-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 f35a1dd5153dd7e7bcbddff808d71c71746520ebc8f9d0f73065f3d3474d4caa
MD5 9ca4435417db9b62baf90901d8445d64
BLAKE2b-256 a3193b13f4b7afef04ebdfe04726532a4dfb534e8919a52174faf00600d2ed91

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.10-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 1fa0ba56b4aa4d88f60442bcd72343bdced8c019e4db350ad99dd660871af58f
MD5 bd2e5e26f6428b868fade2a20a5af546
BLAKE2b-256 339994416ccafb48cb7a3cebbefed35e65a5fd89c521716ce56bd6507f3eef10

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.10-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 304a036e280fcfde9f7cbb01032be58432d9786f2a4d63a234626b16789c99e1
MD5 bc354474ee632a6e800dd67e480f6a55
BLAKE2b-256 a4291b66107536c71836ff42c99208d2d6f7c0af2d7d03294c46de0dc1b1e4f1

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