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

Uploaded CPython 3.10+Windows x86-64

nominal_streaming-0.8.1-cp310-abi3-musllinux_1_2_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ x86-64

nominal_streaming-0.8.1-cp310-abi3-musllinux_1_2_armv7l.whl (3.5 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARMv7l

nominal_streaming-0.8.1-cp310-abi3-musllinux_1_2_aarch64.whl (3.7 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

nominal_streaming-0.8.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ x86-64

nominal_streaming-0.8.1-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (3.2 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARMv7l

nominal_streaming-0.8.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.5 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.17+ ARM64

nominal_streaming-0.8.1-cp310-abi3-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

Details for the file nominal_streaming-0.8.1-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for nominal_streaming-0.8.1-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 a36f97d59920ce987385b27121a96d0f1267eab8808a73110bb37a16c6003d4f
MD5 d53f39a73c9892e4311a1274fc2bf068
BLAKE2b-256 47cc15b1e4f17ced7e963f38329ac1e14dcd69bb7e3726981241eac002a3d509

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.8.1-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 9518681f171a0756b1425830e9a22dd66dd0c04830ab229f33f5dada1e87a482
MD5 9751e496ef544ff024a9298b5ddce4f3
BLAKE2b-256 6625437ab02c1fef04a55478c3b7d1043eddf08e566081421503b6cb8d719ce4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.8.1-cp310-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 c1e904503268263339d0a70fdad0d8ea172507c842605e211b20d0db6737b699
MD5 17c798aed2a40e5952a42bbb9c48bbaa
BLAKE2b-256 9c3198fc8d8ea1f21a8003ba768e7b7a1aa962f98564fc9b951092e3f526d3ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.8.1-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 c06f4ef6f074646695b5fb753a2919bb7ad51fd069d86b69cea8783a370c72d8
MD5 4fac50abbfbf22c5fa299ed9e3a40447
BLAKE2b-256 31fa6296db7a18959f4890d8174fab60f1de409008b0410af44af5adb6209895

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.8.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dd32b2ba0373466a9975bf876793218b1f56fb53fd096433de7b945cfcef6275
MD5 1d62ae0eb532e09f92cc6cd15de2905f
BLAKE2b-256 e36c9c7f4a57ff4221f960e4d22c3c0b1f7fb4c6f585d3b90c368c9637396885

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.8.1-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 eacbfc6beabdc320a4355535ce41fe414631c79ca357a7e1262113f4bfc06471
MD5 6a0d089c6eb9822708b03b85d024b07c
BLAKE2b-256 8f209143d07d3fbc4217c161a881b5196aee7b62422def39cbf406cee9f3bb91

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.8.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a1d92e88a46f19ce5386db56fcc0030c434d2050774181c207721a4042ad77b4
MD5 42612797210a4ad70c1c7fdb93886c5e
BLAKE2b-256 01a2149ef7ccf85c6f38c0fd944bb2b3c7fcde6168256679ef703448e81785a2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.8.1-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3dcbd0f8dd0c2349241dd2985eec6bceb26c8c071d3dc95f0dbeca7342a067f1
MD5 28ae5c6c00b81b527c735c47e8c1a6af
BLAKE2b-256 6aa9a99f3ff64e980bdd50529f1d5f52afb0ef4794c82b0b797c61e905fcaec0

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