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

Uploaded CPython 3.10+Windows x86-64

nominal_streaming-0.7.6-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.6-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.6-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.6-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.6-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.6-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.6-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.6-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for nominal_streaming-0.7.6-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 263db594793b09a6c0fbce5d2aa0f65b61cbf54e1324c303426970840860253f
MD5 fe69e161bcf890cc7406e4053f92d8a5
BLAKE2b-256 d200af255ec3787d5814af9bd75493c4471fbd0863b6f83df5c8a7548bd43ebe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.6-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 1ae1d08d96f8423af35c43efa851686b655c3e19a6e160fd0f84c3c5c537de31
MD5 25705c25b50e76fb0f4e1188d0691885
BLAKE2b-256 09f22ac142f541cb30bf7e10696a4a7a5ed64866be5610e3305a973f398a09c4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.6-cp310-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 0be67aa7ce3ed8ea04b9b597f378cc5e7f4614f845da494be81a22dd01754a66
MD5 e242192c7858d12cc5176b6e13a68e89
BLAKE2b-256 3f8e3114e18d84de0c8d94cd2273fbe8de4ef7737e4b8a8e56f724f524ae9c7b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.6-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 6395821802d8332e631b693e9efe2997a10c1e4f4cee14fde9388a02b3a36566
MD5 4e95bf304c8774a289cf6dfb8b05bf47
BLAKE2b-256 c03ffdb65525bfed3954bc9047dc33d8ad95eb80d8246a9b9ff303fc17b76d58

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.6-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 25758b7bee2fcb96fbe5cc65a192ddb4ef5366a7fdd0465896023b065d39806c
MD5 3ffecc15e18d245e42b04fd83bc4d40f
BLAKE2b-256 6427a8f2202d56205e299a908c3d93df2e867c2d65be422548b0652a4e105fa0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.6-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 d4f2c8cdbaf983af2e27f2b2f9274a929df06eb4440cd1b900982f45811dfdcd
MD5 9432ae46636830e6f5f62d9b86c95287
BLAKE2b-256 acf9614952242752758e1e9c1750d63f8c8efa4d54daf4dcf14cb3f66b7fd84a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.6-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 27e33f761dc66d13763ca597057a356aedc1c01a260ee60b54505d15134a30d3
MD5 25d73b559da3ed04ca2135007f04545a
BLAKE2b-256 893896ff4f1f34f0c25b76e5f7674c89e2fa412d84b998808cc935a3ca009879

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.6-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c16fcd0a0496f87ced5a4896d34ba06884826f0578e254873c9abdb19fbcf0c3
MD5 90e47f19854a2c7aee84cfc910103790
BLAKE2b-256 e22b3569628850325454d55b6000a5547cdf1359815e4cff75349015ace28e03

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