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

Uploaded CPython 3.10+Windows x86-64

nominal_streaming-0.7.9-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.9-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.9-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.9-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.9-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.9-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.9-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.9-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for nominal_streaming-0.7.9-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 7d9ae0e946db760749a6da105e8e9b5ed1fa936d8516b4aa2b075a8bbe5476c1
MD5 0324f13a77d02efa0be10d00bd9ffe16
BLAKE2b-256 f692fa82fc07d2373c1aef64af391ade41888e140eee64a4b472c366e9bceca1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.9-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e7c09a3e195a2469f439370969e4f98b9c2707c8e0c4b453064bb94ab4518355
MD5 4ed75404c65f9bb28ba0a9134286f485
BLAKE2b-256 0fac9894058b710b44c5e4210868916a89b921e67f49f607a0735f8a68307267

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.9-cp310-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 c30e2f8db74023e29ed418f02b2ddea97ad56444863cb032f6c39a1947808e0c
MD5 5779951923521563fa38d68cfe003593
BLAKE2b-256 a141662e2a2ba6738a29e1d4c436d332bc2c28bdd80909384cb67c1762cb60b8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.9-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 274c088fd47ff2f5bad090031ec69c8e0743a1ffdeb8210c1cb0b129f73e1cd7
MD5 b86c8cefe5d9178198e23f8c72e0de44
BLAKE2b-256 a7941dbe9590c02c1b8faaec88d4381e36a68341b42d4f3b74ae71c8883b85b7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.9-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 93d872751f3c5d9462e7f3d1070bfb917297553751830cc5c72df29354484624
MD5 8f66f8a769adf8ecc40c0ec24f45cdaf
BLAKE2b-256 9a6ad42dc4d0c6df73f17354a904661a85d5f78d6e0ad7bedcea939c131dc7ce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.9-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 63aed286b94a2ef7814dc476e22740ca8d91a8797ff03053c031f18a204b6fa2
MD5 a1dbc3f6bcf7271a4c5a00695d91a421
BLAKE2b-256 4b1b1643e0070afd4ac9a58a9e09223187ba7c88832bcf37d42df0a10597a43c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.9-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0d91e57ecb6322a0c0c8aa40fdb94c741bc091001b3e74adcb398d1e94edcfe1
MD5 4a3a411b9fc38956e08756ab4eeec08b
BLAKE2b-256 f6fdecbfd21a7e2972c37fd5ed271fc3445e70efc78be30f1040c2d7e675457a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.9-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a9405c7337704ba29e4082733667e49c0da54e1bf70405e42945520db6dd386d
MD5 92b1748ba9be9f413947065f0cc60231
BLAKE2b-256 fc21233c4e505f3cc96c04fffb875f6600741bfce8b88c88180375ad79e228ae

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