Skip to main content

Documentation hosted here.

To install: pip install stream2py

stream2py

Bring data streams to python, with ease.

One of the goals of the suite of i2i tools is to get from idea 2 implementation without all the fuss. We've got py2store to do that for the storage (reading or writing) concern, and others (e.g. py2cli, py2ws, py2dash) to take care of exposing python functions to the world (of command line interfaces, webservices, browser dashboards, etc.).

Here, we address the stream acquisition concern. As always, we aim at offering as-simple-as-drawing-a-simple-drawing means to get things done.

Plugins

stream2py has the core functionality, and is completely dependency-free (only builtin python).

That said, to work with specific stream sources, you can install plugins that will allow you to work with them. At the time of writing this we have:

What stream2py is for

Reduce vocabulary entropy

One way we do this is by reducing the vocabulary entropy: We don't want to have to think about how every specific source calls a read, or a size, or a time to pause before reads, or what format THAT particular sensor is encoding it's data in, having you shuffle through documentation pages before you can figure out how to start doing the fun stuff, which happens to be the stuff that actually produces value. And, oh, once you figure it out, if you don't use it for a few months or years, next time you need to do something similar, you'll have to figure it all out again.

No. That's just a waste of time of time. Instead, we say you do that at most once. You don't have to do it at all if the community (us) already provided you with the their-language-to-our-consistent-language adapter for the stream you want to hook into. And if it's something new, well you'll have to figure it out, but you then write the adapter once, and now you (1) can use the rest of stream2py's tools and (2) you don't have to do it again.

Go back in time

We also address the problem of impermanence.

Think of the streams that different sensors such as audio, vibration, video offer, or even "industrial" signals such as wifi, can bus data, PLC, etc. They happen, and they're gone. Sure, they usually have buffers, but these are typically just big enough to get the data from high frequency reads -- not enough to have the time for some more involved analysis that smart systems require.

We address this problem by

Multi readers

It often happens that you want to do more than one thing with a stream. Say store it, visualize it in real time, and direct it to a analysis pipeline. In order for this to be possible with no hiccups, some things need to be taken care of. We did, so you don't have to.

Timestamp correctly

In our extensive experience with people (the write code to store stream data), we've noticed that many engineers, when faced with the task to timestamp the segments of stream that they're saving, follow a design pattern that goes like this (a) get the stream data (b) ask the system what date/time it is (c) use that (and perhaps, just to make even more likely for the timestamp to be interpreted incorrectly, call it the "offset_date")

The problem with this design pattern is that it's all pattern and no design. It is not the timestamp of the beginning of the segment: That time happened after the end of the event of the end of the segment occurred, and even more so, after the system that will timestamp and store. Further, there is a lot of wiggle room in the delay accumulated between the actual event, and the moment we ask the system what time it is. Sometimes it doesn't matter, but sometimes it does: For example, if we want to align with some other timestamped data, or use these timestamps to determine if there's gaps or overlaps between the segments we've acquired.

Point is, stream2py will give you the tools to tackle that problem properly. It does so by having the stream2py buffers mentioned above keep data flow statistics that readers can then use to more precisely timestamp what they read.

Documentation here.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stream2py-1.0.44.tar.gz (62.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stream2py-1.0.44-py3-none-any.whl (53.5 kB view details)

Uploaded Python 3

File details

Details for the file stream2py-1.0.44.tar.gz.

File metadata

  • Download URL: stream2py-1.0.44.tar.gz
  • Upload date:
  • Size: 62.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for stream2py-1.0.44.tar.gz
Algorithm Hash digest
SHA256 a5f81b57d1757d0f82d541287eabccebb4faa235cf1c06b4eff6f7fdef485b0a
MD5 7a645fcd0c09266d028107873a061fef
BLAKE2b-256 96fba27c3f68d5b15957525a8d60a2875adac8dbe0f319fedcebc1540a438a1b

See more details on using hashes here.

File details

Details for the file stream2py-1.0.44-py3-none-any.whl.

File metadata

  • Download URL: stream2py-1.0.44-py3-none-any.whl
  • Upload date:
  • Size: 53.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for stream2py-1.0.44-py3-none-any.whl
Algorithm Hash digest
SHA256 a8d60928772a14568b5770a98104667ac92c0d6c95264f84f5feedf3e5d7eb31
MD5 41ec698b93817d7218935005ad7b32f5
BLAKE2b-256 1806a3a8cd702f240f0d5bab73b2c140833e4de84b7e0f88a152b9466eb52c40

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.44 This release

2 files

1.0.43

2 files

1.0.42

1 file

1.0.41

1 file

1.0.40

1 file

1.0.39

1 file

1.0.38

1 file

1.0.37

1 file

1.0.36

1 file

1.0.35

1 file

1.0.34

1 file

1.0.33

1 file

1.0.32

1 file

1.0.31

1 file

1.0.30

1 file

1.0.29

1 file

1.0.28

1 file

1.0.27

1 file

1.0.26

1 file

1.0.25

1 file

1.0.24

1 file

1.0.23

1 file

1.0.22

1 file

1.0.21

1 file

1.0.20

1 file

1.0.19

1 file

1.0.18

1 file

1.0.17

1 file

1.0.16

1 file

1.0.15

1 file

1.0.14

1 file

1.0.13

1 file

1.0.12

1 file

1.0.11

1 file

1.0.10

1 file

1.0.6

2 files

1.0.4

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page