Skip to main content

A Pythonic DSL and XML builder for Flowgorithm (.fprg) programs.

Project description

flowo

A Pythonic DSL and XML builder for Flowgorithm (.fprg) programs.

Ported and redesigned from the Rust crate fgrs, flowo allows you to generate complex Flowgorithm programs using modern Python syntax, including context managers for control flow and strict variable validation.

Features

  • Context Manager API: Natural Pythonic syntax for nested structures (with flow.if_():, with flow.for_():).
  • Strict Validation: Prevents invalid Flowgorithm variable names (no snake_case, no leading numbers) 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 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")

Reserved Keywords

Flowgorithm has strict rules for identifiers. flowo automatically validates your variable names against these rules:

  • No symbols or underscores (no snake_case).
  • Cannot start with a number.
  • Cannot be a reserved word (e.g., and, or, pi, integer, real).
  • Cannot be an intrinsic function name (e.g., abs, cos, len).

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.0.tar.gz (8.6 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.0-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: flowo-0.1.0.tar.gz
  • Upload date:
  • Size: 8.6 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.0.tar.gz
Algorithm Hash digest
SHA256 49081b5f87c8fad13935ab26fe16b4bab7aeb1b65c775eb021d0e746092f22ed
MD5 2f6af0744b516038e284833a3ff396d8
BLAKE2b-256 26f82664565f2ee5bffc787fe86d6908a6b7018baa469a688587d1ecec1ce1d7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: flowo-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 352eff841ddfcd8514f144efe9c1f226894dcae9199fd039ca007d37ddf700fd
MD5 c96e1629c2dff77b96fcbdcc5dcb0710
BLAKE2b-256 0c67d43434eb18e189159d6b9f892533db45bfd030e208da874cd22d766db101

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