Skip to content

API Reference

python_package_template

This is the python_package_template package.

add(a, b)

Add two integers.

Parameters:

Name Type Description Default
a int

The first integer.

required
b int

The second integer.

required

Returns:

Name Type Description
int int

The sum of the two integers.

Source code in python_package_template/main.py
21
22
23
24
25
26
27
28
29
30
31
def add(a: int, b: int) -> int:
    """Add two integers.

    Args:
        a (int): The first integer.
        b (int): The second integer.

    Returns:
        int: The sum of the two integers.
    """
    return a + b

hello(name='world')

Return a greeting string.

Parameters:

Name Type Description Default
name str

The name to greet.

'world'

Returns:

Name Type Description
str str

The greeting string.

Source code in python_package_template/main.py
 9
10
11
12
13
14
15
16
17
18
def hello(name: str = 'world') -> str:
    """Return a greeting string.

    Args:
        name (str): The name to greet.

    Returns:
        str: The greeting string.
    """
    return f'Hello {name}'

multiply(a, b)

Multiply two integers.

Parameters:

Name Type Description Default
a int

The first integer.

required
b int

The second integer.

required

Returns:

Name Type Description
int int

The product of the two integers.

Source code in python_package_template/main.py
47
48
49
50
51
52
53
54
55
56
57
def multiply(a: int, b: int) -> int:
    """Multiply two integers.

    Args:
        a (int): The first integer.
        b (int): The second integer.

    Returns:
        int: The product of the two integers.
    """
    return a * b

subtract(a, b)

Subtract one integer from another.

Parameters:

Name Type Description Default
a int

The integer to subtract from.

required
b int

The integer to subtract.

required

Returns:

Name Type Description
int int

The difference of the two integers.

Source code in python_package_template/main.py
34
35
36
37
38
39
40
41
42
43
44
def subtract(a: int, b: int) -> int:
    """Subtract one integer from another.

    Args:
        a (int): The integer to subtract from.
        b (int): The integer to subtract.

    Returns:
        int: The difference of the two integers.
    """
    return a - b