用于从jinja模板配置python项目的实用程序。
fig-p的Python项目详细描述
fig-py是用于生成python骨架的命令行工具 来自jinja模板目录的包。
界面很简单:
fig -p my-new-project -g my-github-user-name
这将初始化一个高度自以为是的github存储库, 在下面的相关位置插入命令行参数 目录树:
my-new-project ├── README.md ├── build_docs.sh ├── docs │ ├── Makefile │ ├── _static │ │ └── logo.png │ ├── _themes │ │ ├── flask_theme_support.py │ │ └── kr │ │ ├── autotoc.html │ │ ├── layout.html │ │ ├── relations.html │ │ ├── sidebarlogo.html │ │ ├── static │ │ │ └── flasky.css_t │ │ └── theme.conf │ ├── conf.py │ ├── index.rst │ └── install.rst ├── requirements.txt ├── setup.py ├── src │ └── __init__.py └── tests ├── README.md ├── __init__.py ├── fixtures │ └── README.md └── tests.py
此默认模板附带nose用于测试,sphinx用于 文档(使用kenneth reitz的模板),travis-ci表示连续 集成和pandoc,用于在上呈现markdown readme.md 派皮。
您可以通过运行build.sh来构建和提供文档。
自定义
如果愿意,还可以创建自己的文件夹jinja 模板并按如下方式传入:
fig -p my-new-project -g my-github-user-name -t path/to/my-template/
如果需要,还可以传入一系列自定义json键值对 添加额外上下文:
fig -p my-new-project -g my-github-user-name -t my-template/ -k "{'key1':'value1', 'key2':'value2'}"
这些值可以插入自定义模板中的任何位置,使用 标准jinja语法:
{{ key1 }}, {{ key2 }}
以下是完整的cli规范:
usage: fig [-h] [-p PROJECT_NAME] [-g GITHUB_USER] [-a AUTHOR] [-e EMAIL] [-d DESCRIPTION] [-t TEMPLATE_PATH] [-k KWARGS] Initialize a python repository. optional arguments: -h, --help show this help message and exit -p PROJECT_NAME, --project-name PROJECT_NAME The name of your project. -g GITHUB_USER, --github-user GITHUB_USER Your github user name. -a AUTHOR, --author AUTHOR Your name. -e EMAIL, --email EMAIL Your email. -d DESCRIPTION, --description DESCRIPTION The projects' description. -t TEMPLATE_PATH, --template TEMPLATE_PATH A directory of custom templates -k KWARGS, --kwargs KWARGS A json string or a .json / .yml filepath of custom kwargs
安装
pip install fig-py
待办事项:*不要依赖于os.system()*创建存储库 github*激活virtualenv*webhooks以读取文档/s3 上传数据/二进制文件。