glacier:使用docstrings和typehints构建Python CLI

时间:2021-03-25 11:58:50
【文件属性】:
文件名称:glacier:使用docstrings和typehints构建Python CLI
文件大小:28KB
文件格式:ZIP
更新时间:2021-03-25 11:58:50
python cli productivity library python3 冰川 glacier是面向极简主义者的python CLI构建库。 安装 pip install glacier 快速开始 您只需要针对入口点函数调用glacier 。 from glacier import glacier def main ( name : str , verbose : bool = False ) -> None : pass if __name__ == '__main__' : glacier ( main ) 然后,您可以看到帮助 :shortcake: 。 基本用法 不带子命令的CLI 如果你只需要调用glacier的功能,它会调用它作为独立的CLI(比如上例中)。 带有子命令的CLI 您可以通过以下两种方式使用子命令轻松构建CLI。 传递功能列表 from glacier import glacier def run ( name : str , ve
【文件预览】:
glacier-master
----poetry.lock(24KB)
----pyproject.toml(604B)
----.github()
--------workflows()
----glacier()
--------core.py(8KB)
--------misc.py(425B)
--------__init__.py(34B)
--------docstring.py(8KB)
----tests()
--------utils.py(2KB)
--------__init__.py(0B)
--------test_core.py(7KB)
--------test_docstring.py(4KB)
----LICENSE(1KB)
----mypy.ini(303B)
----setup.cfg(228B)
----examples()
--------options.py(172B)
--------sub_commands_named.py(321B)
--------positional_arguments.py(184B)
--------nested.py(268B)
--------command_dead_simple.py(138B)
--------default.py(143B)
--------sub_commands.py(331B)
--------command.py(636B)
--------async_contaminated.py(279B)
--------docstring.py(1KB)
----.gitignore(2KB)
----Makefile(408B)
----README.md(9KB)

网友评论