File: first_step_1.py

package info (click to toggle)
python-hug 2.6.0-2.4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 4,072 kB
  • sloc: python: 8,938; sh: 99; makefile: 17
file content (8 lines) | stat: -rw-r--r-- 273 bytes parent folder | download
1
2
3
4
5
6
7
8
"""First API, local access only"""
import hug


@hug.local()
def happy_birthday(name: hug.types.text, age: hug.types.number, hug_timer=3):
    """Says happy birthday to a user"""
    return {"message": "Happy {0} Birthday {1}!".format(age, name), "took": float(hug_timer)}