Skip to main content

Async service toolchain

Project description

PyFreeFlow

Definition

This library enables the creation of services by composing elementary modules into an operation flow. It is designed to be usable even by non-programmers: the library automatically manages parallel execution and error handling. The user only needs to describe the process to be executed.

The flow is defined as a directed graph:

it can have 1..N input nodes and 1..N output nodes;

if multiple output nodes exist, one can be selected as the final result (all nodes are still executed);

each node’s output is passed as input to the next node in the graph.

A special module type, DataTransformer, allows data transformation between nodes with different types, formats, or structures. Since each node’s output is consumed by the following node, a state object is also passed to each node. This makes it possible to store data (usually through DataTransformer) for later use within the flow.

The library is extensible through dynamically loadable modules that follow a defined specification.

To configure a pipeline (the executable unit), two elements are required:

  • the list of nodes;
  • the graph definition, written in dot syntax.

Command line tool

A command-line tool is included to execute pipelines defined in a Yaml file. The file must contain three sections: ext, args, pipeline.

  • ext: list of additional extensions to load.
  • args: input parameters for the pipeline.
  • pipeline: definition of the flow.

Example: password encryption

ext:
- pyfreeflow.ext.crypto_operator
args:
  username: jdoe
  password: password
pipeline:
  digraph:
  - parseArgs -> createJson
  - createJson -> prepareEncrypt
  - prepareEncrypt -> encrypt
  - encrypt -> prepareSaveFile
  - prepareSaveFile -> saveFile
  name: crypto
  node:
  - config:
      transformer: |2
        data = {op = "write", data = {username = data.username, password = data.password}}
    name: parseArgs
    type: DataTransformer
    version: '1.0'
  - name: createJson
    type: JsonBufferOperator
    version: '1.0'
  - config:
      transformer: |2
        data = {op = "encrypt", data = data, key = "fernet.key"}
    name: prepareEncrypt
    type: DataTransformer
    version: '1.0'
  - name: encrypt
    type: FernetCryptoOperator
    version: '1.0'
  - config:
      transformer: |2
        data = {op = "write", data = data, path = "pass.enc"}
    name: prepareSaveFile
    type: DataTransformer
    version: '1.0'
  - config:
      binary: false
    name: saveFile
    type: AnyFileOperator
    version: '1.0'

Pipeline configuration parameters

  • name: pipeline name (optional)
  • digraph: connections between nodes, identified by unique names
  • node: node definitions used in the digraph

Node definition parameters

  • config: configuration parameters specific to the module
  • name: unique node name
  • type: module type implementing the node
  • version: version of the module

For details about individual modules, refer to their documentation.

License

This software is available under dual licensing:

Non-Commercial Use - AGPL v3

For non-commercial use, this software is released under the GNU Affero General Public License v3.0. Any modifications must be shared under the same license.

Commercial Use

For commercial use, please contact me.

Project details


Download files

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

Source Distribution

pyfreeflow-0.3.0.tar.gz (40.8 kB view details)

Uploaded Source

Built Distribution

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

pyfreeflow-0.3.0-py3-none-any.whl (49.9 kB view details)

Uploaded Python 3

File details

Details for the file pyfreeflow-0.3.0.tar.gz.

File metadata

  • Download URL: pyfreeflow-0.3.0.tar.gz
  • Upload date:
  • Size: 40.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for pyfreeflow-0.3.0.tar.gz
Algorithm Hash digest
SHA256 8ef729b872f4f10b5ac3ed9746f59e99a03ea325c29d26409dcd66ae0df763a6
MD5 64540d5ff4f2a4bec0c784e677d9b4d8
BLAKE2b-256 199239faf30886dda906be19c26281f549fc3a289c318a9a3f4e911267fa77c7

See more details on using hashes here.

File details

Details for the file pyfreeflow-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: pyfreeflow-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 49.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for pyfreeflow-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d0a4d5e5a0d8cf3e5ad9c1670c9c75c676cf7a1398dea9a00649fe1937b596bf
MD5 731974d5712be694b9cfa1abf3afc078
BLAKE2b-256 846eaa2d740ec990b1a698607e9ff70b583ef4d3450fceec34e3b13e43f8f98e

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