A simple package for applying transformations to streaming data.
Stream Conversion
This package can handle stream functions and stream generators.
Here's an example with functions:
from random import randint
from stream_converter.converter import convert_function_stream
def get_random_number() -> int:
return randint(0, 100)
converted_stream = convert_function_stream(
stream_function=get_random_number,
conversion_function=lambda byte: str(byte),
)
for converted_chunk in converted_stream:
print(converted_chunk)
And here's an example with generators:
from random import randint
from typing import Generator
from stream_converter.converter import convert_generator_stream
def get_random_number_generator() -> Generator[int, None, None]:
while True:
yield randint(0, 100)
converted_stream = convert_generator_stream(
stream_generator=get_random_number_generator(),
conversion_function=lambda int: "odd" if int % 2 else "even"
)
for converted_chunk in converted_stream:
print(converted_chunk)
Built-In Stream Support
Microphone via PyAudio
from stream_converter.converter import convert_generator_stream, convert_function_stream
from stream_converter.microphone_stream import get_microphone_stream_generator, MicrophoneStream
# generator
converted_stream = convert_generator_stream(
stream_generator=get_microphone_stream_generator(),
conversion_function=lambda byte: str(byte),
)
for converted_chunk in converted_stream:
print(converted_chunk)
# function
with MicrophoneStream() as microphone_stream:
converted_stream = convert_function_stream(
stream_function=microphone_stream.read,
conversion_function=lambda byte: str(byte),
)
for converted_chunk in converted_stream:
print(converted_chunk)
Metadata
Release files for stream-converter 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| stream_converter-1.0.0.tar.gz | 2.1 kB | Without provenance | Details for stream_converter-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| stream_converter-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for stream_converter-1.0.0-py3-none-any.whl |
Total release size: 5.2 kB
Release files / stream_converter-1.0.0.tar.gz
| Download URL | stream_converter-1.0.0.tar.gz |
|---|---|
| Size | 2.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
affba3e0cc32630aaf384b0df11a197e713aadd7f3ec046c962637d648c872c6
|
|
BLAKE2b-256 checksum How to use checksums |
7dfc006c950e498fe36b6f872a33917f3eff62a2d595ed5959348a57e1815bba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / stream_converter-1.0.0-py3-none-any.whl
| Download URL | stream_converter-1.0.0-py3-none-any.whl |
|---|---|
| Size | 3.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
403687a3be55b608847fb530e8e48efaf2ec514f6de7a4674ba52d649fcf03b7
|
|
BLAKE2b-256 checksum How to use checksums |
7e261e2d51a6fa9e17102c33c6334dbba400f6e478efe20283ec27e01ad3f6fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Security for stream-converter 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.