Reference
This part of the project documentation focuses on an information-oriented approach. Use it as a reference for the technical implementation of the project code.
example_app.app
get_pokemon(number=Path(title='The Pokémon to get (based on number)', ge=1, le=151))
Endpoint that returns information about Pokémon.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
number |
int
|
The number of the Pokémon to get |
Path(title='The Pokémon to get (based on number)', ge=1, le=151)
|
Returns:
Type | Description |
---|---|
dict
|
Awesome information about the Pokémon! |
Source code in example_app/app.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
example_app.service
Provides several sample functions.
The module contains the following functions:
foo(a, b)
- Returns the sum of two numbers (int).- `bar(a)' - Returns a hello message with the input string.
bar(name='Frank Herbert')
Says 'Hello' with input.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
input string |
'Frank Herbert'
|
Returns:
Type | Description |
---|---|
str
|
A 'Hello' message. |
Source code in example_app/service.py
32 33 34 35 36 37 38 39 40 41 42 |
|
foo(a, b)
This is a description what the function does.
Examples:
>>> foo(a=1, b=2)
3
>>> foo(a=4, b=15)
19
Parameters:
Name | Type | Description | Default |
---|---|---|---|
a |
int
|
This is the first summand |
required |
b |
int
|
This is the second summand |
required |
Returns:
Type | Description |
---|---|
int
|
The summation of a and b. |
Source code in example_app/service.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
|