Skip to main content

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.

Requires Python 3.11 or newer.

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.

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"}
        )

Runtime metrics

Enable PyNominalStreamOpts(track_metrics=True) (or pass track_metrics=True to NominalDatasetStream.create) to emit dictionary enqueue staleness and Core request latency metrics. Metrics are disabled by default.

NumPy batches

NumPy is optional: install nominal-streaming[numpy], or use the NumPy installation already provided by your application. Pass arrays directly to enqueue_batch:

import numpy as np

timestamps = np.array([1_700_000_000_000_000_000, 1_700_000_000_000_000_001], dtype="uint64")
values = np.array([1.25, 2.5], dtype="float64")
stream.enqueue_batch("temperature", timestamps, values)

Native-endian, aligned, one-dimensional NumPy arrays are copied into Rust-owned memory without creating a Python object for every element. The fast path supports int64/uint64 timestamps and float32/float64/int64/uint64 values, including strided, reversed, and read-only views. Integer values retain the API's existing conversion to doubles. Inputs can be changed or freed after the call returns.

Other dtypes, unaligned or non-native-endian arrays, and ndarray subclasses use the existing element-wise conversion. Masked values and datetime/timedelta values still require explicit conversion. Lists and tuples continue to work without NumPy.

Building and testing wheels

All builds use the Python 3.11 stable ABI (cp311-abi3) with native NumPy buffer support. Build a wheel with the standard workspace command:

uv build --package nominal-streaming

NumPy is never needed to import the library or use lists. CI shares one wheel across parallel Python 3.11 through 3.15 jobs. Each job exercises lists without NumPy, then runs the batch regression tests and type checks with the locked test dependencies. To run tests locally with the test dependency group:

uv run --group test python -m unittest discover -s py-nominal-streaming/tests -v

Measuring enqueue performance

With a wheel and the test dependencies installed:

python py-nominal-streaming/benchmarks/enqueue_batch.py

This compares direct arrays, pre-existing lists, and .tolist() plus the enqueue call. It reports all samples and medians and reads the local Avro output to verify point counts and value checksums. It measures the complete public enqueue call with buffer capacity available; startup and draining are excluded. It does not measure network throughput. Downstream serialization, compression, and upload backpressure can limit the overall streaming improvement.

Metadata

Release files for nominal-streaming 0.10.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for nominal-streaming 0.10.5
File Actions
nominal_streaming-0.10.5-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for nominal_streaming-0.10.5-cp311-abi3-win_amd64.whl
nominal_streaming-0.10.5-cp311-abi3-musllinux_1_2_x86_64.whl CPython 3.11 abi3 Linux musl 1.2+ x86-64 Details for nominal_streaming-0.10.5-cp311-abi3-musllinux_1_2_x86_64.whl
nominal_streaming-0.10.5-cp311-abi3-musllinux_1_2_armv7l.whl CPython 3.11 abi3 Linux musl 1.2+ ARMv7l Details for nominal_streaming-0.10.5-cp311-abi3-musllinux_1_2_armv7l.whl
nominal_streaming-0.10.5-cp311-abi3-musllinux_1_2_aarch64.whl CPython 3.11 abi3 Linux musl 1.2+ ARM64 Details for nominal_streaming-0.10.5-cp311-abi3-musllinux_1_2_aarch64.whl
nominal_streaming-0.10.5-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details for nominal_streaming-0.10.5-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
nominal_streaming-0.10.5-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl CPython 3.11 abi3 Linux glibc 2.17+ ARMv7l Details for nominal_streaming-0.10.5-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
nominal_streaming-0.10.5-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details for nominal_streaming-0.10.5-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
nominal_streaming-0.10.5-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for nominal_streaming-0.10.5-cp311-abi3-macosx_11_0_arm64.whl

Total release size: 30.7 MB

Release files / nominal_streaming-0.10.5-cp311-abi3-win_amd64.whl

Download URL nominal_streaming-0.10.5-cp311-abi3-win_amd64.whl
Size 4.2 MB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
4902e25f533ea9d371f79891f64308d89219ed385f436075041d9fc0c2e64fca
BLAKE2b-256 checksum
How to use checksums
10889d82616e5d482eef627a713e54fba7a8b26e39af0a84d97213af78b9127e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.24

Release files / nominal_streaming-0.10.5-cp311-abi3-musllinux_1_2_x86_64.whl

Download URL nominal_streaming-0.10.5-cp311-abi3-musllinux_1_2_x86_64.whl
Size 4.1 MB
Tags CPython 3.11 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
d1b03a3065dbbcdd281b8a79dce35f5d6fcb880de26d6dc697d5a0c4f3862c33
BLAKE2b-256 checksum
How to use checksums
250b6f6d9f59ec8549201dda2f561885ed0da97bb88f59d94f113d01a15c447e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.24

Release files / nominal_streaming-0.10.5-cp311-abi3-musllinux_1_2_armv7l.whl

Download URL nominal_streaming-0.10.5-cp311-abi3-musllinux_1_2_armv7l.whl
Size 3.7 MB
Tags CPython 3.11 Linux musl 1.2+ ARMv7l abi3
SHA-256 checksum
How to use checksums
49474ca8add7c4e0dd09cb3aa137efd1c4a813574b143bd068185d2a6d756bd6
BLAKE2b-256 checksum
How to use checksums
c9ebd0e45d0df1dadf5acd1dbb911359742a973f9f216a06821809e98c1601b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.24

Release files / nominal_streaming-0.10.5-cp311-abi3-musllinux_1_2_aarch64.whl

Download URL nominal_streaming-0.10.5-cp311-abi3-musllinux_1_2_aarch64.whl
Size 3.9 MB
Tags CPython 3.11 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
4411856f0ba44a3caafd38ca8e47e32b224321f753d96d894506cf769884274a
BLAKE2b-256 checksum
How to use checksums
1d33189551fecefd3f94511b7304527854ad7a864fbbbbb37e57f2806a83ccee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.24

Release files / nominal_streaming-0.10.5-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL nominal_streaming-0.10.5-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 4.0 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
4ddb84a27ea68e37e600a0c1d5d3a9d55642ff275b62c327c0922dbebf63f6fe
BLAKE2b-256 checksum
How to use checksums
b84981364854044c62676e39c5a6a5e45e3ec4fdb0b021713b9cd22f705b410b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.24

Release files / nominal_streaming-0.10.5-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl

Download URL nominal_streaming-0.10.5-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Size 3.5 MB
Tags CPython 3.11 Linux glibc 2.17+ ARMv7l abi3
SHA-256 checksum
How to use checksums
de9e5021c5e1fa4ec5521be5f237f9796cf96b700830bc95fb4985ddc41c2c2a
BLAKE2b-256 checksum
How to use checksums
7ebc0116de9ee5de48429358b93a0d5b315e6c6acc309f028b8499d96662f82c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.24

Release files / nominal_streaming-0.10.5-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL nominal_streaming-0.10.5-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 3.7 MB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
ed98b7652270f5d7c25184f78f9a4aa3dd671dc2342b2d4ea55cf0ab38b27a92
BLAKE2b-256 checksum
How to use checksums
e77e38de892366904105e6cfe0d86eaa6e7abfbe7d82fcb3f4edcd8ab839a1fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.24

Release files / nominal_streaming-0.10.5-cp311-abi3-macosx_11_0_arm64.whl

Download URL nominal_streaming-0.10.5-cp311-abi3-macosx_11_0_arm64.whl
Size 3.7 MB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e78d056513b7de6b545096c2b22c5dd49c8fa903b9342345972321a898e01d3c
BLAKE2b-256 checksum
How to use checksums
db3875323dd37c5522e3c3b2f656871cb319cde5df8df275d61125bc2f75b214
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.24

Security for nominal-streaming 0.10.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.10.5 This release

8 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page