Skip to content

yamause

Example of a package with a single module.

Yamause

MkDocsプラグインをデモンストレーションするクラス。

このクラスには、数値に1を加えるメソッドがあります。

Source code in src/yamause/example.py
class Yamause:
    """MkDocsプラグインをデモンストレーションするクラス。

    このクラスには、数値に1を加えるメソッドがあります。
    """

    def __init__(self):
        pass

    def add_one(self, num: int) -> int:
        """指定された数値に1を加えます。

        Examples:
            >>> yamause = Yamause()
            >>> yamause.add_one(1)
            2

        Args:
            num (int): 加える対象の数値。

        Returns:
            int: 数値に1を加えた結果。
        """
        return num + 1

    def say(self) -> str:
        """'Hello, world!'をコンソールに出力します。

        Returns:
            str: 'Hello, world!'という文字列。
        """
        return 'Hello, world!'

add_one(num)

指定された数値に1を加えます。

Examples:

>>> yamause = Yamause()
>>> yamause.add_one(1)
2

Parameters:

Name Type Description Default
num int

加える対象の数値。

required

Returns:

Name Type Description
int int

数値に1を加えた結果。

Source code in src/yamause/example.py
def add_one(self, num: int) -> int:
    """指定された数値に1を加えます。

    Examples:
        >>> yamause = Yamause()
        >>> yamause.add_one(1)
        2

    Args:
        num (int): 加える対象の数値。

    Returns:
        int: 数値に1を加えた結果。
    """
    return num + 1

say()

'Hello, world!'をコンソールに出力します。

Returns:

Name Type Description
str str

'Hello, world!'という文字列。

Source code in src/yamause/example.py
def say(self) -> str:
    """'Hello, world!'をコンソールに出力します。

    Returns:
        str: 'Hello, world!'という文字列。
    """
    return 'Hello, world!'

add_one(hogehoge)

指定された数値に1を加えます。

Examples:

>>> add_one(1)
2

Parameters:

Name Type Description Default
hogehoge int

加える対象の数値。

required

Returns:

Name Type Description
int int

数値に1を加えた結果。

Source code in src/yamause/example.py
def add_one(hogehoge: int) -> int:
    """指定された数値に1を加えます。

    Examples:
        >>> add_one(1)
        2

    Args:
        hogehoge (int): 加える対象の数値。

    Returns:
        int: 数値に1を加えた結果。
    """
    return hogehoge + 1

say()

'Hello, world!'をコンソールに出力します。

Returns:

Name Type Description
str str

'Hello, world!'という文字列。

Source code in src/yamause/example.py
def say() -> str:
    """'Hello, world!'をコンソールに出力します。

    Returns:
        str: 'Hello, world!'という文字列。
    """
    return 'Hello, world!'