Skip to main content

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

Installing

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

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

# examply.py
from enum import Enum
from datetime import datetime, date, time


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)):
  pass

$ touch-callable example.py

demo

Control Water Dispenser

# examply.py
from enum import Enum


class 开关(Enum):
   = '开'
   = '关'


def 饮水机(口令: str, 制热: 开关=None, 制冷: 开关=开关('开')):
  """这是 20618 的!"""
  if 口令 != '多喝热水':
    raise ValueError('你是谁,我不认识你')

  # 省略具体逻辑

$ touch-callable example.py

demo

Project details


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.3.tar.gz (1.7 MB view hashes)

Uploaded Source

Built Distribution

touch_callable-0.0.3-py3-none-any.whl (1.7 MB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page