Metadata-Version: 2.4
Name: func-to-web
Version: 2.7.6
Summary: Expose typed Python functions as web interfaces.
Author: Beltrán Offerrall
License: MIT License
        
        Copyright (c) 2025 Beltrán Offerrall
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/offerrall/FuncToWeb
Project-URL: Documentation, https://offerrall.github.io/func-to-web/
Project-URL: Repository, https://github.com/offerrall/FuncToWeb
Keywords: web,forms,type-hints,ui
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pytypehintweb==1.2.0
Requires-Dist: starlette==0.49.3
Requires-Dist: uvicorn==0.38.0
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"
Requires-Dist: pytest-asyncio; extra == "test"
Requires-Dist: httpx; extra == "test"
Requires-Dist: build; extra == "test"
Requires-Dist: twine; extra == "test"
Requires-Dist: fastapi==0.121.1; extra == "test"
Provides-Extra: test-outputs
Requires-Dist: pandas; extra == "test-outputs"
Requires-Dist: polars; extra == "test-outputs"
Requires-Dist: numpy; extra == "test-outputs"
Requires-Dist: pillow; extra == "test-outputs"
Requires-Dist: matplotlib; extra == "test-outputs"
Provides-Extra: test-browser
Requires-Dist: playwright; extra == "test-browser"
Dynamic: license-file

# 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.

```python
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](https://offerrall.github.io/func-to-web/): one function as a form, an API, a contract and a modal; how it works.
- [Getting started](https://offerrall.github.io/func-to-web/getting-started/): `run()`, several functions, FastAPI, the options and the examples.
- [Types and validation](https://offerrall.github.io/func-to-web/types/): what a parameter can be, and its constraints.
- [Files](https://offerrall.github.io/func-to-web/files/): file parameters, uploads and how long files are kept.
- [Outputs](https://offerrall.github.io/func-to-web/outputs/): text, tables, images and downloads.
- [Prefill and OpenForm](https://offerrall.github.io/func-to-web/prefill/): forms that open filled in, and functions that open other forms.
- [HTTP API](https://offerrall.github.io/func-to-web/http/): `/invoke`, streaming and `/doc`.
- [`sdk.js`](https://offerrall.github.io/func-to-web/sdk/): calling a space and opening its forms from your own frontend.
- [Security and limits](https://offerrall.github.io/func-to-web/security/): what FuncToWeb guarantees, and what is up to you.
