Skip to content

INIT - Python [PKG1]#

main #

MyMain #

Main class for pkg1.

This class serves as the entry point for pkg1 functionality. It demonstrates how the package can coordinate different components (e.g., sub modules and external utilities).

method_main(inp: str) -> None #

Print the supplied message.

Parameters:

Name Type Description Default
inp #
str

The message to print to stdout.

required
Source code in packages/pkg1/src/pkg1/main.py
def method_main(self, inp: str, /) -> None:
    """Print the supplied message.

    Args:
        inp (str): The message to print to stdout.
    """
    print(inp)

run() -> None #

Execute the demo flow of pkg1.

The function joins a static list of words via :class:MySub, passes the resulting string to :class:MyMain, and finally calls the :func:main function from shared_utils.hello.

Source code in packages/pkg1/src/pkg1/main.py
def run() -> None:
    """Execute the demo flow of pkg1.

    The function joins a static list of words via :class:`MySub`,
    passes the resulting string to :class:`MyMain`, and finally
    calls the :func:`main` function from ``shared_utils.hello``.
    """
    message = " ".join(MySub().method_sub(["Hello", "world", "!"]))
    MyMain().method_main(message)
    main()

sub #

sub #

MySub #

Utility helper that simply echoes a list of strings.

This lightweight class demonstrates how a sub-package can expose small building blocks that other parts of the application (or external consumers) can use.

method_sub(arg: list[str]) -> list[str] #

Return the supplied list unchanged.

Parameters:

Name Type Description Default
arg #
list[str]

A list of strings that will be returned verbatim.

required

Returns:

Type Description
list[str]

list[str]: The same list that was passed in.

Notes

This method does not modify the input list and simply forwards it. It exists only to provide a concrete implementation for the pkg1.main module to call.

Source code in packages/pkg1/src/pkg1/sub/sub.py
def method_sub(self, arg: list[str], /) -> list[str]:
    """Return the supplied list unchanged.

    Args:
        arg (list[str]): A list of strings that will be returned
            verbatim.

    Returns:
        list[str]: The same list that was passed in.

    Notes:
        This method does not modify the input list and simply
        forwards it. It exists only to provide a concrete
        implementation for the ``pkg1.main`` module to call.
    """
    return arg

INIT - Python [shared]#

hello #

main() -> None #

Prints a simple greeting from the shared utilities package.

This function is intended as a lightweight demo to show that the shared_utils sub-package is correctly installed and importable from other packages in the monorepo.

Source code in packages/shared_utils/src/shared_utils/hello.py
def main() -> None:
    """Prints a simple greeting from the shared utilities package.

    This function is intended as a lightweight demo to show that the `shared_utils`
    sub-package is correctly installed and importable from other packages
    in the monorepo.
    """
    print("Hello from shared!")