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

Uploaded CPython 3.10+Windows x86-64

nominal_streaming-0.7.12-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.12-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.12-cp310-abi3-musllinux_1_2_aarch64.whl (3.4 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

nominal_streaming-0.7.12-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.12-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.12-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.12-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.12-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for nominal_streaming-0.7.12-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 5f9882cf6fd82d46956b70f435b16734fcb845214fc4fd2a823d05fa81f3621a
MD5 50a0ca9d814f93446cc65a2ce946facc
BLAKE2b-256 00edfad20c542f307e6d59c92c5df809a2f63bbc32976189e884439a9e5a98a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.12-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a4963c3e49671f8aea08fe5e3cc5f770744ad73dbf6e5f2ff05f31e998923a1a
MD5 0d3307acbcd24671dc2f7cea1dc2b2bc
BLAKE2b-256 5dcb46c0fd44ba3f33f2b8303b3425d275021e6559b990fd9dd8b7c3b58fc23b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.12-cp310-abi3-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 9b9508b89862b8c9d23514662ad7d32838438d147d97bbc463032602c93cd83e
MD5 1c2190e0da32cdf63a50673dc6e847f7
BLAKE2b-256 e8feb202667acfebb09123b1b5a63a4cd2b01e0df45fcf443407c5f46cfb1744

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.12-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 906d25f34214963426a1898b54477b1f2f6e6492232dacb735a5a4b8072a6928
MD5 e919664ad908032b55d4952a904bf8a3
BLAKE2b-256 49fe858eed69c42a542802f8a63b2eb265420b8b1979f42b96c79f4124bea94f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.12-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8512ca6507058595a220cec68a8ca8b58a04dc91522049abab6dc210f3192086
MD5 7c0fde905047e13b098ed9a7a82cc71e
BLAKE2b-256 4a42a42c9acfa56cdba5ff59f3988b6b49cd7a985bba6dce467547d62cc9736c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.12-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 ecff691afd289c2810fc3aa666cb1ebcbd1dd34704597af0fd270b437887cde9
MD5 8c7e4595ab8c2e7dd1de683821a5c4f4
BLAKE2b-256 59a7ca350959078d13714b4d0561ed9f894bfa47df0cb67fcdf63b788fbb1008

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.12-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 07fe1e4764ed2eba7a224b6b5a6c0e292427355ae7015e09072e6967f4ec333b
MD5 e64be6fbf924302b7d24d3323df8e08e
BLAKE2b-256 aed2279810bfc34e88b5ddf55fb100b34d337a1905c66345ee3f82412535b929

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for nominal_streaming-0.7.12-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3d87d515d33abed102c8c0d70b5197677bd1821a25f883769dee3c6e0e955bc9
MD5 b5bbd7d2439298b47a9ddd175af770b5
BLAKE2b-256 c102d37454e0b3fc0a5d4e847059e22da40ced85d8189760629ea4f2c6cd9a9b

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