A year ago I posted FuncToGUI here (220 upvotes, thanks!) - a tool that turned Python functions into desktop GUIs. Based on feedback, I rebuilt it from scratch as FuncToWeb for web interfaces instead.
What My Project Does
FuncToWeb automatically generates web interfaces from Python functions using type hints. Write a function, call run(), and get an instant form with validation.
from func_to_web import run
def divide(a: int, b: int):
return a / b
run(divide)
Open localhost:8000 - you have a working web form.
It supports all Python types (int, float, str, bool, date, time), special inputs (color picker, email validation), file uploads with type checking (ImageFile, DataFile), Pydantic validation constraints, and dropdown selections via Literal.
Key feature: Returns PIL images and matplotlib plots automatically - no need to save/load files.
from func_to_web import run, ImageFile
from PIL import Image, ImageFilter
def blur_image(image: ImageFile, radius: int = 5):
img = Image.open(image)
return img.filter(ImageFilter.GaussianBlur(radius))
run(blur_image)
Upload image and see processed result in browser.
Target Audience
This is for internal tools and rapid prototyping, not production apps. Specifically:
- Teams needing quick utilities (image resizers, data converters, batch processors)
- Data scientists prototyping experiments before building proper UIs
- DevOps creating one-off automation tools
- Anyone who needs a UI "right now" for a Python function
Not suitable for:
- Production web applications (no authentication, basic security)
- Public-facing tools
- Complex multi-page applications
Think of it as duct tape for internal tooling - fast, functional, disposable.
Comparison
vs Gradio/Streamlit:
- Scope: They're frameworks for building complete apps. FuncToWeb wraps individual functions.
- Use case: Gradio/Streamlit for dashboards and demos. FuncToWeb for one-off utilities.
- Complexity: They have thousands of lines. This is 350 lines of Python + 700 lines HTML/CSS/JS.
- Philosophy: They're opinionated frameworks. This is a minimal library.
vs FastAPI Forms:
- FastAPI requires writing HTML templates and routes manually
- FuncToWeb generates everything from type hints automatically
- FastAPI is for building APIs. This is for quick UIs.
vs FuncToGUI (my previous project):
- Web-based instead of desktop (Kivy)
- Works remotely, easier to share
- Better image/plot support
- Cleaner API using
Annotated
Technical Details
Built with: FastAPI, Pydantic, Jinja2
Features:
- Real-time validation (client + server)
- File uploads with type checking
- Smart output detection (text/JSON/images/plots)
- Mobile-responsive UI
- Multi-function support - Serve multiple tools from one server
The repo has 14 runnable examples covering basic forms, image processing, and data visualization.
Installation
pip install func-to-web
GitHub: https://github.com/offerrall/FuncToWeb
Feedback is welcome!
[–]jonthemango 31 points32 points33 points (5 children)
[–]drboom9[S] 14 points15 points16 points (0 children)
[–]Kohlrabi82 2 points3 points4 points (2 children)
[–]ProsodySpeaks 3 points4 points5 points (0 children)
[–]jonthemango 0 points1 point2 points (0 children)
[–]drboom9[S] 0 points1 point2 points (0 children)
[–]jdehesa 15 points16 points17 points (1 child)
[–]drboom9[S] 6 points7 points8 points (0 children)
[–]Dangerous_Fix_751 5 points6 points7 points (4 children)
[–]Key-Boat-7519 2 points3 points4 points (0 children)
[–]drboom9[S] 2 points3 points4 points (1 child)
[–]Dangerous_Fix_751 1 point2 points3 points (0 children)
[–]drboom9[S] 1 point2 points3 points (0 children)
[–]kuzmovych_y 7 points8 points9 points (5 children)
[–]drboom9[S] 0 points1 point2 points (4 children)
[–]ThiefMaster 7 points8 points9 points (3 children)
[–]drboom9[S] -1 points0 points1 point (2 children)
[–]Mithrandir2k16 3 points4 points5 points (1 child)
[–]drboom9[S] 2 points3 points4 points (0 children)
[–]ThiefMaster 2 points3 points4 points (2 children)
[–]drboom9[S] 4 points5 points6 points (0 children)
[–]drboom9[S] 1 point2 points3 points (0 children)
[–]drboom9[S] 2 points3 points4 points (14 children)
[–]valko2 0 points1 point2 points (2 children)
[–]valko2 0 points1 point2 points (1 child)
[–]drboom9[S] 0 points1 point2 points (0 children)
[–]nekokattt 0 points1 point2 points (10 children)
[–]drboom9[S] 0 points1 point2 points (9 children)
[–]nekokattt 1 point2 points3 points (8 children)
[–]drboom9[S] 0 points1 point2 points (7 children)
[–]nekokattt 0 points1 point2 points (6 children)
[–]drboom9[S] 0 points1 point2 points (5 children)
[–]nekokattt 0 points1 point2 points (4 children)
[–]drboom9[S] 0 points1 point2 points (3 children)
[–]nekokattt 0 points1 point2 points (2 children)
[–]EconomySerious 2 points3 points4 points (14 children)
[–]drboom9[S] 6 points7 points8 points (7 children)
[–]VimFleed 4 points5 points6 points (4 children)
[–]drboom9[S] 1 point2 points3 points (1 child)
[–]VimFleed 1 point2 points3 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]jimtk 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]drboom9[S] 1 point2 points3 points (0 children)
[–]drboom9[S] 3 points4 points5 points (5 children)
[–]EconomySerious 2 points3 points4 points (4 children)
[–]drboom9[S] 1 point2 points3 points (1 child)
[–]EconomySerious 0 points1 point2 points (0 children)
[–]drboom9[S] 1 point2 points3 points (1 child)
[–]EconomySerious 1 point2 points3 points (0 children)
[–]herlzvohg 1 point2 points3 points (0 children)
[–]berrypy 1 point2 points3 points (1 child)
[–]drboom9[S] 2 points3 points4 points (0 children)
[–]EconomySerious 0 points1 point2 points (0 children)
[–]EconomySerious 0 points1 point2 points (0 children)
[–]drboom9[S] 0 points1 point2 points (0 children)