Modular event-centric python library made for simplification typical stream applications development with python type system strong exploitation.
Project description
typed-blocks
Modular event-centric python library made for simplification typical stream applications development with python type system strong exploitation.
from dataclasses import dataclass
from blocks import App, source, processor
@dataclass
class E:
x: int
@dataclass
class E2:
y: int
@source
def generator() -> E:
return E(1)
@processor
def printer(e: E) -> E2:
print('1', e)
return E2(e.x)
@processor
def printer2(e: E2) -> None:
print('2', e)
blocks = (generator(), printer(), printer2())
App(blocks).run(once=True)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
typed-blocks-0.9.4.tar.gz
(27.1 kB
view details)
Built Distribution
File details
Details for the file typed-blocks-0.9.4.tar.gz
.
File metadata
- Download URL: typed-blocks-0.9.4.tar.gz
- Upload date:
- Size: 27.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49a4041c5e5ffd172491114e6b3fbc1e9fe5893106a31c3ec6a45079514d55b5 |
|
MD5 | 286f7397e187f1552709568e5f675e23 |
|
BLAKE2b-256 | 309d4cca3c9107e36add1e688c0574ee732215241a38c2fe6c99531b81063188 |
File details
Details for the file typed_blocks-0.9.4-py3-none-any.whl
.
File metadata
- Download URL: typed_blocks-0.9.4-py3-none-any.whl
- Upload date:
- Size: 37.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.0 CPython/3.9.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 564139a5a38b815e9f89eeaffa016ae59dc25af62e799b0d0b32c213de5b3018 |
|
MD5 | 6fccb44f042c52fa61c60fd009b0629c |
|
BLAKE2b-256 | 5cdb5c6813841633532a3d26c50f11a59966b3d9c3cd32d37a2c68c05bd3eb54 |