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

Uploaded CPython 3.10+Windows x86-64

nominal_streaming-0.8.0-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.0-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.0-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.0-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.0-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.0-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.0-cp310-abi3-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.8.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 5a6cc1cdff6601bbafa1bbe797984eb982bc8c1aa3bb9567ac9089a8315a6d7d
MD5 5d0069ee532ab7dec09c74f0deca686f
BLAKE2b-256 ca34c0909434d526efb571977f52ead0fb83a9af5bf40eeb7948103da87064dc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.8.0-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 cec3a32039ba818d55b0277e2b5c01f2228768da7f4e8c50b4530f4d32f3dac2
MD5 08e0f1c79f10d686c5f4f8341d31b33c
BLAKE2b-256 29c6a6fcf3dd65565e481959a888372c50a4fe1c6d46491aa4d3a2305cd801b7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.8.0-cp310-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 a4efb075af90fe90e482e91f45491850b15b5e29e406f4eb62f20f7c11962726
MD5 4238ec9602a00fb7b4ba24894236c573
BLAKE2b-256 a59406c79895778a89e835a81ba0f68c77ae918e7a2110fa2abe5743b455c95c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.8.0-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 2100505f2be25ea95a1b59e8c288bdee14b08bde7d9197de55214e5d4cd47268
MD5 28f6ecefc215297cb9a653af2804222a
BLAKE2b-256 1584cd690e56afff2cb5c075bace0e51573eb7923badd78cfd658a8b12416fc4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.8.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6225b7502223621a32543512b5f98890c2eadf07d53ccf59ff7f3b61d2726407
MD5 aaa449fe2fdf328afb1ad7cbad842848
BLAKE2b-256 9ee1df29477d17af06602cab720ac7bb5670212e4e030ff3edd801c41db6bd16

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.8.0-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 1af47cd476285f6367b4617c84ea6ad13834f368872bf4f00544d36d2f5b89b7
MD5 8903c328a9f01321bdb97ee07955fbab
BLAKE2b-256 3ea503d8e8c3f126b56c9593183c6d0101c0a4ebcb7846d364444423614d44a7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.8.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 59e352eac0283c4e08ddb9c4cecc0e86bb3354331686949d8caf5cda51ecec4e
MD5 aa84803952ec4ef8adc60009bb1dd5af
BLAKE2b-256 7f89371ee1cd25499f0661a1c3e6ccbdaf844330759960b8eeea409071d7f6f2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.8.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 77961eed3b23a34d44984128b4bc2b4b52835724dc0b551b781882e7a0cf52e6
MD5 1b710ea46729fefdaaa68f331b0c5b83
BLAKE2b-256 357ac7ce9832754f5fe2c0e9828feb1860724d7471a402eb6521a461e103c9c1

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