Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

DagStream

DagStream is the Python package in order to manage relationship between functions, especially for data-preprocessing functions for machine learning applications. It offers simple API similar to taskflow.

For more details, please refer to docs below.

How to install

You can intall dagstream by using pip.

pip install dagstream

Basic Usage

Definition of Dag

DagStream class convert your functions into dag nodes.

import dagstream

def funcA():
    print("funcA")

def funcB():
    print("funcB")

def funcC():
    print("funcC")

def funcD():
    print("funcD")

def funcE():
    print("funcE")

def funcF():
    print("funcF")


stream = dagstream.DagStream()
A, B, C, D, E, F = stream.emplace(funcA, funcB, funcC, funcD, funcE, funcF)

A.precede(B, C)
E.succeed(B, C, D)
D.succeed(C)
F.succeed(E)

Execute whole dag functions

dagstream execute the functions based on relationship you defined.

from dagstream.executes import StreamExecutor

# construct functional dag
functional_dag = stream.construct()
executor = StreamExecutor(functional_dag)
executor.run()

In console, follwing items are shown.

funcA
funcC
funcB
funcD
funcE
funcF

Draw relationship of functions using Mermaid

You can draw function dag relationship by using Mermaid.

from dagstream.viewers import MermaidDrawer

functional_dag = stream.construct()
drawer.output(functional_dag, "path/to/output.mmd")

The output is shown like below.

stateDiagram
    direction LR
    state "funcC" as state_0
    state "funcB" as state_1
    state "funcD" as state_2
    state "funcA" as state_3
    state "funcF" as state_4
    state "funcE" as state_5
    [*] --> state_0
    state_0 --> state_1
    state_0 --> state_2
    state_1 --> state_4
    state_2 --> state_3
    state_2 --> state_4
    state_3 --> state_4
    state_4 --> state_5
    state_5 --> [*]

Metadata

Release files for dagstream 0.1.0.dev202310040616

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for dagstream 0.1.0.dev202310040616
File Interpreter ABI Platform
dagstream-0.1.0.dev202310040616-py3-none-any.whl Python 3 none any Details

Release files / dagstream-0.1.0.dev202310040616-py3-none-any.whl

Download URL dagstream-0.1.0.dev202310040616-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f82261361808a6a7a7bd38d627d8c27126d0aeb1506877a9307c2622faf3363d
BLAKE2b-256 checksum
How to use checksums
6e25b3dc80a6c063aa911f5b443a78490bb3f16f30b177501d01aa8df0bfd5ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.6.1 CPython/3.9.18 Linux/5.4.0-155-generic

Security for dagstream 0.1.0.dev202310040616

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.

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