The web framework for less serious application.
Project description
Touch-Callable
The web framework for less serious application.
Auto generat Web UI for Python Functions.
English | 简体中文
Support platforms
- macOS
- Ubuntu
- Windows
Installation
Only support Python 3.6!
pip install -U touch-callable
Support Function Argument types
- str
- int
- float
- bool
- datetime.datetime
- datetime.date
- datetime.time
- enum.Enum
- io.BytesIO
- typing.BinaryIO
CommandLine args
--host
Default is 172.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
--port
Default is 6789.
--debug
enable Flask debug feature(not recommend)
Default is False, if you want to enable it
$ touch-callable example.py --debug True
Examples
All support types
# 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
Responsive UI:
Control Water Dispenser
# example.py
from enum import Enum
class 开关(Enum):
开 = '开'
关 = '关'
def 饮水机(口令: str, 制热: 开关=None, 制冷: 开关=开关('开')):
"""这是 20618 的!"""
if 口令 != '多喝热水':
raise ValueError('你是谁,我不认识你')
# 省略具体逻辑
$ touch-callable example.py
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
touch-callable-0.0.4.tar.gz
(1.8 MB
view hashes)
Built Distribution
Close
Hashes for touch_callable-0.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac6d4b978b0430a97ade10b3aeeaa48ed45f9fc04f5414a7852bc735f21382e0 |
|
MD5 | 7e0d1f667657904b0a02c0b454cbc65a |
|
BLAKE2b-256 | 43755ddffa06e03b317e891d742b19cfc67556fc795e4575dd4b85ec9ca8cb66 |