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.

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)

Python 3.11+ wheels copy native-endian, aligned, one-dimensional NumPy arrays 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.

Python 3.10 wheels retain the element-wise path and emit one RuntimeWarning per process on the first array batch. On that build, .tolist() can be faster; on an accelerated build, pass supported arrays directly. Python 3.11+ installers prefer the accelerated wheel when both variants are available.

Building and testing the two wheels

Both variants use the same sources and public API. Build them separately:

maturin build --release -m py-nominal-streaming/Cargo.toml --no-default-features --features python310
maturin build --release -m py-nominal-streaming/Cargo.toml --no-default-features --features python311

The output tags are cp310-abi3 and cp311-abi3, respectively. The default source build targets Python 3.10. Cargo features are additive: enabling both selects the older ABI and disables buffer acceleration, so use --no-default-features for the Python 3.11 variant. NumPy is never needed to import the library or use lists.

CI installs each built wheel in a clean environment, checks its compiled capability, exercises lists without NumPy, and runs the batch regression tests with NumPy on the minimum and newer Python runtimes. To run tests locally after installing a wheel and the test dependency group:

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.2

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.2
File
nominal_streaming-0.10.2-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details
nominal_streaming-0.10.2-cp311-abi3-musllinux_1_2_x86_64.whl CPython 3.11 abi3 Linux musl 1.2+ x86-64 Details
nominal_streaming-0.10.2-cp311-abi3-musllinux_1_2_armv7l.whl CPython 3.11 abi3 Linux musl 1.2+ ARMv7l Details
nominal_streaming-0.10.2-cp311-abi3-musllinux_1_2_aarch64.whl CPython 3.11 abi3 Linux musl 1.2+ ARM64 Details
nominal_streaming-0.10.2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details
nominal_streaming-0.10.2-cp311-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl CPython 3.11 abi3 Linux glibc 2.17+ ARMv7l Details
nominal_streaming-0.10.2-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details
nominal_streaming-0.10.2-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details
nominal_streaming-0.10.2-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
nominal_streaming-0.10.2-cp310-abi3-musllinux_1_2_x86_64.whl CPython 3.10 abi3 Linux musl 1.2+ x86-64 Details
nominal_streaming-0.10.2-cp310-abi3-musllinux_1_2_armv7l.whl CPython 3.10 abi3 Linux musl 1.2+ ARMv7l Details
nominal_streaming-0.10.2-cp310-abi3-musllinux_1_2_aarch64.whl CPython 3.10 abi3 Linux musl 1.2+ ARM64 Details
nominal_streaming-0.10.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details
nominal_streaming-0.10.2-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl CPython 3.10 abi3 Linux glibc 2.17+ ARMv7l Details
nominal_streaming-0.10.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details
nominal_streaming-0.10.2-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details

Total release size: 61.3 MB

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

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

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

Download URL nominal_streaming-0.10.2-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
08cc8f1ec1dc750eda6b28774832a9235b94dac0678bff0651c463f0e1bc9bde
BLAKE2b-256 checksum
How to use checksums
e370f7cbb735d88d5687d810c43a8fc918f88a3480125d07207efc22ebc73c55
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.24

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

Download URL nominal_streaming-0.10.2-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
c2332c3305dbfb781ba55bc723794981857ee5eafdd7553b6547b67e787bbddd
BLAKE2b-256 checksum
How to use checksums
11f6c136087410a70a4bcdbd1f32ce8917bbb3e2cf7e025f16e9ec2132a3d345
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.24

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

Download URL nominal_streaming-0.10.2-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
abf523a41a2fb46ee281b2b3fe376d990ec64d077c23178346ebd68a005a1c02
BLAKE2b-256 checksum
How to use checksums
9010b22081ee998a48fdbad041ab57bac9f38ff550bb0e7e3f22b72f3f99ddef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.24

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

Download URL nominal_streaming-0.10.2-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
55f5c6c311750389bf412615101325919a099412f7e0340bf5293671999a0a04
BLAKE2b-256 checksum
How to use checksums
4a294381cddda9636f95392741b5652f7656c96aca0c635d6d1b85b0271dedfa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.24

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

Download URL nominal_streaming-0.10.2-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
259c7db69f77f2641e6e089705b2473ad00e9787d0edcd54876088b5ed78b011
BLAKE2b-256 checksum
How to use checksums
660e91a5cb26b81b305f06760aa43e85bd6c100902caeda39eb352727c3748fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.24

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

Download URL nominal_streaming-0.10.2-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
0d8590a5f6e0eb45d61f3ef2529d3dc54998e0ba886f554a9550d2beece42603
BLAKE2b-256 checksum
How to use checksums
072ad78722067108a966daec6d61022071ffa374dc6890bd75fa08a373d19fb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.24

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

Download URL nominal_streaming-0.10.2-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
7d672b3ab946c2df3dd4e43925311b5f88b8c9013ed0eb9ec939d985dea66773
BLAKE2b-256 checksum
How to use checksums
731311c4267e90bc4be79df2e3c884f081f663f32f1360825ca1a1956f06dc71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.24

Release files / nominal_streaming-0.10.2-cp310-abi3-win_amd64.whl

Download URL nominal_streaming-0.10.2-cp310-abi3-win_amd64.whl
Size 4.2 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
325e75eff5d6cfa2c0183a15fccf19cdef192e3be3f4af4f333fa0715e19df52
BLAKE2b-256 checksum
How to use checksums
0d635f2ca04ddee2bca96434dd573c9fea2313a3227f4141c0fa8a90beb50914
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.24

Release files / nominal_streaming-0.10.2-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL nominal_streaming-0.10.2-cp310-abi3-musllinux_1_2_x86_64.whl
Size 4.1 MB
Tags CPython 3.10 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
4650727f1945bfaa06bf1bb5114bca0aeb74f7ec22300b877d8793c8d8065271
BLAKE2b-256 checksum
How to use checksums
f4beba741ceec9051da1970f8c4b4b547e8b51bf13f03039b53f619806e0b443
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.24

Release files / nominal_streaming-0.10.2-cp310-abi3-musllinux_1_2_armv7l.whl

Download URL nominal_streaming-0.10.2-cp310-abi3-musllinux_1_2_armv7l.whl
Size 3.7 MB
Tags CPython 3.10 Linux musl 1.2+ ARMv7l abi3
SHA-256 checksum
How to use checksums
5e6a7a6108a936501d3ee980a695c46395d8a3d49d61ae9e40ef8a2efc998210
BLAKE2b-256 checksum
How to use checksums
461b35f1116b0cc997054cc7500b41b40eb978ada0cdd75d34f71766d8e91630
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.24

Release files / nominal_streaming-0.10.2-cp310-abi3-musllinux_1_2_aarch64.whl

Download URL nominal_streaming-0.10.2-cp310-abi3-musllinux_1_2_aarch64.whl
Size 3.9 MB
Tags CPython 3.10 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
f615b7e75052d5464e23caf69fc8c0aa410eeb7051a4ed98297f783556848a76
BLAKE2b-256 checksum
How to use checksums
fc5fd20670bacbb55cddd2108545efc3569e6edc25907235af75e3ade4e69a5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.24

Release files / nominal_streaming-0.10.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL nominal_streaming-0.10.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 4.0 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
631de67050258296da8cd12961fcbc4936e9b77631d523894a7a9f18b7623400
BLAKE2b-256 checksum
How to use checksums
2cca716996cf54f0b6683162665a70f7990a6cfe1901df2a8d8d6c10f960ede2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.24

Release files / nominal_streaming-0.10.2-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl

Download URL nominal_streaming-0.10.2-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Size 3.4 MB
Tags CPython 3.10 Linux glibc 2.17+ ARMv7l abi3
SHA-256 checksum
How to use checksums
409f510dd67a5177227dc8d652d9788c3a9ea385e0ce4f6a2efaaafea86d57a3
BLAKE2b-256 checksum
How to use checksums
ea699a37c34d915711f55fee81aed0d0ce7ebe951de947e2093b3f913ea2d67a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.24

Release files / nominal_streaming-0.10.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL nominal_streaming-0.10.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 3.7 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
91efd73d3ce9e1c79fca9b005179631a43694224518e3bc25a451c098be7d411
BLAKE2b-256 checksum
How to use checksums
4cfa3f65f980524d5a1b286d58a7404b28e51c8cc2b16e18899431203ab4d82b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.24

Release files / nominal_streaming-0.10.2-cp310-abi3-macosx_11_0_arm64.whl

Download URL nominal_streaming-0.10.2-cp310-abi3-macosx_11_0_arm64.whl
Size 3.7 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
46b462434b0e81456fe01c81ffca423e9f0e28b8b757b645924d6a0dc6ddba10
BLAKE2b-256 checksum
How to use checksums
ec63fe0b4ac3b2ee425ae3251a952c7f2b30d15d7237c8801cedbe2e225ce98c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.24

Release history Release notifications | RSS feed

This release

0.10.2 This release

16 release files

0.10.0

8 release files

0.9.10

8 release files

0.9.9

8 release files

0.9.8

7 release files

0.9.7

8 release files

0.9.6

8 release files

0.9.5

8 release files

0.9.4

8 release files

0.9.3

8 release files

0.9.2

8 release files

0.9.1

8 release files

0.9.0

8 release files

0.8.2

8 release files

0.8.1

8 release files

0.8.0

8 release files

0.7.11

8 release files

0.7.10

8 release files

0.7.9

8 release files

0.7.8

8 release files

0.7.7

8 release files

0.7.6

8 release files

0.7.5

8 release files

0.7.4

8 release files

0.7.3

7 release files

0.7.2

7 release files

0.7.1

7 release files

0.7.0

7 release files

0.6.0

7 release files

0.5.8

7 release files

0.5.7

7 release files

0.5.6

7 release files

0.5.5

7 release files

0.5.4

7 release files

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