Skip to content

offerrall/FuncToWeb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Func To Web 0.7.4

GitHub stars PyPI version Python Tests License

Transform any Python function into a complete web app automatically. Just type hints and run().

func-to-web Demo

Quick Start (30 seconds)

pip install func-to-web
from func_to_web import run

def divide(a: int, b: int):
    return a / b

run(divide)

Open http://127.0.0.1:8000You have a working web app!

Demo


Complete Feature Overview

Complete documentation with examples and screenshots for each feature:

Input Types

Features

  • Validation: Pydantic constraints (min/max, regex, list validation)
  • Images & Plots: Return PIL Images and Matplotlib figures
  • File Downloads: Return FileResponse for any file type
  • Multiple Functions: Auto-generated index page
  • Function Descriptions: Display docstrings in the UI
  • Dark Mode: Automatic theme switching
  • Large Files: Optimized streaming (GB+ files)
  • Progress Bars: Real-time upload/download tracking
  • Error Handling: Beautiful error messages

Full Documentation API Reference


Quick Examples

Check the examples/ folder for 20+ complete examples:

python examples/01_basic_division.py
python examples/08_image_blur.py
python examples/15_multiple_tools.py
python examples/20_lists_limits.py

Requirements

  • Python 3.10+
  • FastAPI
  • Uvicorn
  • Pydantic
  • Jinja2
  • python-multipart

Optional for examples:

  • Pillow (for image processing)
  • Matplotlib (for plots)
  • NumPy (for numerical computations)

Development dependencies:

  • pytest (for running tests)

Run Tests

pytest tests/ -v

Deploy Docs

mkdocs gh-deploy

MIT LicenseMade by Beltrán Offerrall • Contributions welcome!

About

Transform any Python function into a web interface automatically. Zero boilerplate

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published