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

Uploaded CPython 3.10+Windows x86-64

nominal_streaming-0.7.5-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.5-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.5-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.5-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.5-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.5-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.5-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.5-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for nominal_streaming-0.7.5-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 8f6b72d4c419b86d32865aa5924de8160984d4f92bcac9bac4f1eb6d152ded0a
MD5 068501801b9fd472a4fb1887151c931c
BLAKE2b-256 7fce03cd0dac379602f284cc2bbd2e531328609db6a8cc1e9b9717133b46bffb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.5-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 f882ab72deffa1849e01c1a1b969fd45d7de0d2b8d7387ba86f51f404eefdef2
MD5 17bc24821d56643ef158ddb25d674e69
BLAKE2b-256 b234b91b547b4029b0bf5d6e368fbf69f2aeb1b3ad9e2b3801d844737a7ad85e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.5-cp310-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 4385e1fbad36e6645a358a83621a8d9c1649d8ea4e8712be3fc6045d22e276d1
MD5 440ca86d24adb7f3757db3df321b5d68
BLAKE2b-256 6ff4f43a70cbd604c4d8d182c7eafa858fa1d7c6dc104499455e9d8eaa35f936

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.5-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 fe25bbd33b40e99ca8df6353cca1afbe9c6f1eb0efb9ae290ec869302a292ab5
MD5 ac710c9bc0617017006baea29a02d926
BLAKE2b-256 7eb6f59cf60ec385d582a275747275d6a197c142100c6fd835f645794599a93e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.5-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 00f0ac12802ef3a2017996508c5054bd3e45ffac6cb804002ca6e5351e8a6763
MD5 b06833c9da1d89eb18ab0d1e284e784b
BLAKE2b-256 903b366bb10c0b8979d51d64a48a38416ed08ad2c71399603fa427990041fc56

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.5-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 345d48d499e205e55c223b2ac1c28ad3d1034cee5f798745826464de6def9dd4
MD5 91f8cbf540a3dd25409cc4544ecd5149
BLAKE2b-256 dbe1e02f0a10252197771089fa2270f6387dce82d65a4874829adaa23d35cc88

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.5-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2d2cbc9ed850a3c8956d1a8926f7fea9d351fb61f12c84da571bebeac02af90a
MD5 30d690ec893d7647d27aaac2beda72cd
BLAKE2b-256 907e74feef9ca614467bd9773666800d62ac72c3d997eff62f14597234585d93

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.5-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ac07364606ff08058f467ab2ede7d3991008af45de6f564a48e176b2c6216450
MD5 dbab041fb8ab03d0f55909b270f8a2b9
BLAKE2b-256 855a2052677ed24400b5cdf2294d89952a42da628f1fd046cbbb6c1381626188

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