Skip to main content

No project description provided

Project description

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.executor 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 "funcE" as state_0
    state "funcB" as state_1
    state "funcF" as state_2
    state "funcD" as state_3
    state "funcC" as state_4
    state "funcA" as state_5
    state_0 --> state_2
    state_1 --> state_0
    state_2 --> [*]
    state_3 --> state_0
    state_4 --> state_0
    state_4 --> state_3
    [*] --> state_5
    state_5 --> state_4
    state_5 --> state_1

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 Distribution

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

dagstream-0.1.6-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file dagstream-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: dagstream-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 13.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.9.21 Linux/5.15.0-126-generic

File hashes

Hashes for dagstream-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 59fa03bc38acd4c8fb5c5f0851647e0831e14a9e38733d04c13ba510cafc262b
MD5 87362d3f494fc3070bf0fe49b1005a91
BLAKE2b-256 f3862cd21f648cea9530410beb7941f973a4076e869ff5b375a207b6d729cf22

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