The web framework for less serious application.
Automatically generate a Web UI for Python function using type annotations.
English | 简体中文
- macOS
- Ubuntu
- Windows
Only support Python 3.6!
pip install -U touch-callable
- str
- int
- float
- bool
- datetime.datetime
- datetime.date
- datetime.time
- enum.Enum
- io.BytesIO
- typing.BinaryIO
- All objects that can be
json.dumps open('filename.xxx', 'rb'), return values' annotation should beio.BufferedReader
Default is 127.0.0.1, you can only visit it on your computer.
If you want to listen all networks:
$ touch-callable example.py --host 0.0.0.0
Default is 6789.
Default is False, if you want to enable it
$ touch-callable example.py --debug True
# example.py
from datetime import datetime, date, time
from enum import Enum
import io
import typing
class Languages(Enum):
Python = 'Python'
PHP = 'PHP'
Java = 'Java'
def demo(int_: int, str_: str, float_: float, bool_: bool,
enum_: Languages,
datetime_: datetime = datetime.now(),
date_: date = date.today(),
time_: time = time(1, 2, 3),
bytes_io: io.BytesIO = None,
binary_io: typing.BinaryIO = None):
pass$ touch-callable example.py
import io
def return_file() -> io.BufferedReader:
return open('filename', 'rb')
