FuncToWeb
Turn typed Python functions into web interfaces.
Write a normal Python function with type hints. FuncToWeb turns it into a ready-to-use web form, validates its input and runs it over HTTP. No models, no duplicated schemas, no hand-written forms.
The same function is also an HTTP endpoint, a contract published at /doc for
people and agents, an application you mount inside FastAPI, and a page your own
frontend opens in a modal.
from func_to_web import run
def divide(a: float, b: float) -> float:
return a / b # Any exception becomes a clean error in the page and the API
run(divide) # http://127.0.0.1:8000
The full documentation is at https://offerrall.github.io/func-to-web/.
Documentation
- Overview: the same function as a form, an API, a contract and a modal; how it works, what it offers and how it compares.
- Getting started: write your first function and run it.
- Examples: the runnable examples and mini-apps, how to run them, and what each folder teaches.
run(): the standalone application and the space index.app_of(): mounting the application in an existing FastAPI host application.- Types and validation: constraints, dataclasses, lists, unions, optionals and defaults.
- Prefill and hidden parameters: open a form with initial values, from Python or from the URL.
- Files: uploads, reusable file references, and which layer applies each limit.
WebFunctionandWebFunctions: the name, description and slug of a function; prepared spaces.- Execution over HTTP:
/invoke, the request body, the envelope and the status codes. - Streaming:
/invoke-stream, SSE events andprint()capture. - Outputs: text, images, tables and downloads with
Download. OpenForm: open another function's form with the return value as prefill./doc: the published contract that a client or an agent consumes.sdk.js: the helpers that call a space from your own frontend, and how to embed a function's page in another site.- Static assets:
/static, the icons, the theme and how they are cached. - Security: what FuncToWeb covers and what belongs to the host application.
- Architecture: the layers and what each one solves.
- Limitations: the known limits, in a single list.
Maintaining
- The space index: why the page
run()adds at/navigates withlocation.replace()and carries no form logic of its own. - The application: why both storage TTLs default to one hour, and why the theme is resolved in pure CSS.
- Prefill: from the query parameter to the plan: what happens between the
prefillquery parameter and the HTML that is served. - Files: the upload endpoint, the reference and custody: why
/uploaddoes not applyFileHint.max_size, why a second upload of the same reference is a409, and where custody of a promoted file ends up. WebFunctionmetadata: why the description is passed throughcleandoc(), and why only the first letter of a displayed name is uppercased.- Streaming and print capture: how
print()capture works, why it is experimental, and why the transport polls. - Outputs: why table rows are read with
itertuples(), why a matplotlib figure is closed, and why a union cannot mix a download with an ordinary branch. - The iframe channel: three decisions: why the modal does not close itself by default, why
erroris not about validation, and why the payload ofresultis the envelope of/invokeagain. - Frontend: assets, icons and color: why the content type is decided rather than guessed, why every icon is a file, and why the page adds almost no color of its own.
- Architecture: what counts as public contract: why the line between the public API and the merely visible internals falls where it does.
- What changed underneath, from 1.6 to 2.0: why 2.0 breaks what it breaks: the two layers underneath were rewritten, and what that widened, lost and left as a limit.
Metadata
Release files for func-to-web 2.7.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| func_to_web-2.7.5.tar.gz | 52.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| func_to_web-2.7.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 115.4 kB
Release files / func_to_web-2.7.5.tar.gz
| Download URL | func_to_web-2.7.5.tar.gz |
|---|---|
| Size | 52.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e6f6476ee97f72a770ea7a016678520a8d16e6ece53c8558062f25dc598e9dec
|
|
BLAKE2b-256 checksum How to use checksums |
ea42efba9b7a684a3f5cde4765dee231e3413f083eaf0500b2b78b44a06f4eeb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.
Transparency logRelease files / func_to_web-2.7.5-py3-none-any.whl
| Download URL | func_to_web-2.7.5-py3-none-any.whl |
|---|---|
| Size | 63.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
97d605a04d119379285dfd8b3aa49f71fd9391e59c4809c0bd9dce1976ebf827
|
|
BLAKE2b-256 checksum How to use checksums |
b2cadeb9893d5eff7959dccd0737e0dadd09dcf8aeb17db37d7af4d33b288eee
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 29, 2026.
Transparency log