Interfacy is a library for automatically generating CLI applications from Python functions, methods, classes, or instances using their type annotations and docstrings.
- CLI generation from functions, methods, classes, or instances.
- Argument type inference from annotations.
- Required parameters as positionals or flags.
- Subcommands with optional aliases.
- Multiple help text themes.
- Stdin piping support.
- Optional tab completion via argcomplete.
- Support for user-defined type parsers.
pip install interfacyuv add interfacypip install git+https://github.com/zigai/interfacy.gituv add "git+https://github.com/zigai/interfacy.git"def greet(name: str, times: int = 1) -> None:
for _ in range(times):
print(f"Hello, {name}!")
if __name__ == "__main__":
from interfacy import Argparser
Argparser(print_result=True).run(greet)