front#
Dispatching python functions as webservices, docker containers, and GUIs.
front is the core library that concrete UI frameworks (e.g. streamlitfront)
build on: it compiles a configuration into a specification (SpecMakerBase),
builds a tree of UI elements from it (ElementTreeMaker) and assembles the app
(AppMaker). Crudifier and prepare_for_crude_dispatch make functions
with complex arguments operable through string keys into stores.
Consider these three functions:
>>> def foo(a: int = 0, b: int = 0, c=0):
... 'This is foo. It computes something'
... return (a * b) + c
>>> def bar(x, greeting='hello'):
... 'bar greets its input'
... return f'{greeting} {x}'
>>> def confuser(a: int = 0, x: float = 3.14):
... return (a ** 2) * x
The objective here is to be able to do this:
>>> app = dispatch_funcs([foo, bar, confuser], ...)
getting a deployable app that allows the user to operate with these three wonderful
functions. The ellipses (...) are there to indicate that we may want to specify
the kind of app we want (web-service, GUI, CLI…) as well as particular configurations
for the latter.
Modules
The |
|
Base functions for front dispatching: |
|
Crudify functions: let complex arguments be specified by string keys into stores. |
|
Crudify the variable nodes of a |
|
Data-binding primitives that connect front element values to a backing state store. |
|
Front UI elements: bases, tree maker, and component implementer helpers. |
|
Bridge between plain Python functions and pydantic v2 models. |
|
Base classes and conventions for building a |
|
Stateful storage protocols and |
|
Tools using front, or useful when using front. |
|
Type aliases and lightweight dataclasses shared across front modules. |
|
Signature and mapping utilities shared by the front modules. |