Skip to main content

A Pythonic DSL for Flowgorithm (.fprg) that can simplify AI-assisted work by generating valid visual programs from Python code.

Project description

flowo

A Pythonic DSL for Flowgorithm (.fprg) that can simplify AI-assisted work by generating valid visual programs from Python code.

This thing is basically a port and redesign of the Rust crate fgrs.

AI & Vibecoding

Flowgorithm's native XML format is a nightmare for LLMs (like Gemini, Claude, or ChatGPT) to generate correctly. flowo provides a clean, type-safe Python DSL that is significantly easier for AI coding assistants to write.

By using flowo, you can "vibecode" your Flowgorithm assignments by prompting for Python code and letting the library handle the strict XML schema, reserved keywords, and variable declarations automatically.

Features

  • Context Manager API: Natural Pythonic syntax for nested structures (with flow.if_():, with flow.for_():).
  • Strict Validation: Prevents invalid Flowgorithm variable names and reserved keyword usage.
  • Variable Tracking: Ensures variables are declared before use.
  • Intrinsic Functions: Helper functions for all Flowgorithm built-ins (Abs, Sin, Len, ToInteger, etc.).
  • Zero Dependencies: Built entirely on the Python Standard Library.

Installation

pip install flowo

Quick Start

from flowo import Flow, Type

flow = Flow("HelloWorld.fprg")

with flow.function("Main"):
    flow.declare("name", Type.STRING)
    flow.output('"What is your name?"')
    flow.input("name")
    flow.output('"Hello, " & name')

flow.to_fprg()

Advanced Usage

flowo supports all Flowgorithm features (that I've used during my uni study) including arrays, multi-argument declarations, and nested loops:

from flowo import Flow, Type, Sin, PI

flow = Flow()
with flow.function("Main"):
    flow.declare("i, n", Type.INTEGER)
    flow.declare("val", Type.REAL)
    
    flow.assign("n", "10")
    with flow.for_("i", "0", "n - 1"):
        flow.assign("val", Sin(f"(i / n) * 2 * {PI}"))
        flow.output("val")

flow.to_fprg("SineWave.fprg")

License

MIT

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

flowo-0.1.1.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

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

flowo-0.1.1-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file flowo-0.1.1.tar.gz.

File metadata

  • Download URL: flowo-0.1.1.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for flowo-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3f23db2997f40309c699b85165621ca143a57edd83acfdc2bb5e5de42392e5fc
MD5 154edc0c802ac8cb2145bc27fb016484
BLAKE2b-256 5730360a506cfb6846da4265ceec24f00a7b1c41c362fa1955ad0c657e90e382

See more details on using hashes here.

File details

Details for the file flowo-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: flowo-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.10 {"installer":{"name":"uv","version":"0.10.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for flowo-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0e436021eb8f37792d21e6af075b155f7c3a84db0ceeadf5a981d6d231a74ee4
MD5 ef58d6798d6d221f19a4680bb3397b7b
BLAKE2b-256 417ce36208976326a263fea41efd32cfe41b75bda7db9924106c3be45b419819

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