Transform any Python function into a web interface automatically
Project description
Func To Web 0.9.14
Type hints → Web UI. Minimal-boilerplate web apps from Python functions.
FuncToWeb is actively maintained and used in production by myself and the community (featured in Awesome Python). The current version (0.9.x) is stable and production-ready. Version 1.0.0 is in active development with major improvements including function chaining with shared context and cleaner architecture for long-term maintainability. Until then, only critical bug fixes will be released.
Quick Start (30 seconds)
pip install func-to-web
from func_to_web import run
def divide(a: float, b: float):
return a / b
run(divide)
Open |
|
Complete Feature Overview
Complete documentation with examples and screenshots for each feature:
Input Types
|
Output Types
Features
|
Full Documentation API Reference
Perfect For
- ✅ Rapid Prototyping - From pure Python function to usable web interface in seconds.
- ✅ Image Processing - Upload, process, and download images with PIL/Pillow.
- ✅ Data Science & Reporting - Instantly publish Pandas/Polars DataFrames and matplotlib plots without frontend code.
- ✅ High-Performance File Transfer - Stream uploads and downloads at native network/disk speeds. Handles massive files efficiently with minimal memory footprint.
- ✅ Secure Internal Apps - Admin panels, dashboards, and team tools protected by built-in authentication.
Quick Examples
DIY AirDrop / LocalSend (Very Fast File Transfers)
from pathlib import Path
from func_to_web import run
from func_to_web.types import File
desktop_path = Path.home() / "Desktop"
def upload_files(
files: list[File],
):
for f in files:
print(f"Uploaded file: {f}")
return "Files uploaded successfully!"
run(upload_files, auto_delete_uploads=False, uploads_dir=desktop_path)
Secure Admin Panel
Protect sensitive tools with built-in authentication in one line.
import subprocess
from typing import Literal
from func_to_web import run
# 🔒 MANDATORY: Use HTTPS (Nginx).
def restart_service(service: Literal['nginx', 'gunicorn', 'celery']):
"""Restarts a system service."""
# check=True raises an error shown in the Web UI if the command fails
subprocess.run(["sudo", "supervisorctl", "restart", service], check=True)
return f"✅ Service {service} restarted."
run(restart_service, auth={"admin": "super_secret_password"})
QR Code Generator
Generate QR codes instantly from text.
import qrcode
from func_to_web import run
def make_qr(text: str):
"""Returns a QR code image for the given text."""
return qrcode.make(text).get_image()
run(make_qr)
PDF Merger
Merge multiple PDF files into a single document instantly.
from io import BytesIO
from pypdf import PdfWriter
from func_to_web import run
from func_to_web.types import DocumentFile, FileResponse
def merge_pdfs(files: list[DocumentFile]):
"""Upload PDFs and get a single merged file back."""
merger = PdfWriter()
for pdf in files:
merger.append(pdf)
output = BytesIO()
merger.write(output)
return FileResponse(data=output.getvalue(), filename="merged.pdf")
run(merge_pdfs)
Check the examples/ folder for +20 complete examples (Covers all features)
Requirements
Core:
- Python 3.10+
- FastAPI, Uvicorn, Pydantic, Jinja2, python-multipart, itsdangerous
Optional (for extended functionality):
- Pillow, Matplotlib, Pandas, NumPy, Polars
Development:
- pytest, mkdocs, mkdocs-material
Run Tests
pytest tests/ -v
MIT License • Made by Beltrán Offerrall • Contributions welcome!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file func_to_web-0.9.14.tar.gz.
File metadata
- Download URL: func_to_web-0.9.14.tar.gz
- Upload date:
- Size: 3.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5d6aad175e1f9eb5150674e31c8c041ff7abcaf952f7967f44b56cfa2d8bdbf
|
|
| MD5 |
bda76c7b21bd8eb6f072b2e9564a7eb4
|
|
| BLAKE2b-256 |
2588070604f163fb3504149e31f6b091c5209698dbe04bee03d1c26234c943f1
|
File details
Details for the file func_to_web-0.9.14-py3-none-any.whl.
File metadata
- Download URL: func_to_web-0.9.14-py3-none-any.whl
- Upload date:
- Size: 3.9 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44630d8dd69e4d7e888e197f1c1432b568e002945a80518e89846636e34d56b9
|
|
| MD5 |
6e325d3c80117985cf43a102fec72c65
|
|
| BLAKE2b-256 |
b0d32c83639e58570828db7203a630688c8c772f0b4ba30a952f3e1a880b05cc
|