在github上搜索cookiecutters。
cibopath的Python项目详细描述
使用python 3.5在github上搜索Cookiecutter模板。
A Cibopath can take a bite from anything and get a psychic sensation of what has happened to that object. The only thing it does not work on is beets.
用法
Usage: cibopath [OPTIONS] COMMAND [ARGS]... Cibopath - Search Cookiecutters on GitHub. Options: -v, --verbose Print debug information -c, --config-file PATH Config file to hold settings -V, --version Show the version and exit. --help Show this message and exit. Commands: config info search update
用户配置
首先你需要create a GitHub access token为cibopath,这样它就可以 使用GitHub API v3进行身份验证。GitHub’s rate limiting不允许 每小时超过60个未经验证的请求。所以是的,你肯定想 设置一个令牌,因为有60个以上的特征Cookiecutter templates。
cibopath访问令牌不需要not任何scopes。请坚持 创建标记时的默认值(对public的只读访问 存储库)。
现在使用cli将您的凭据存储在主目录中(默认 ~/.cibopathrc)。
$ cibopath config github.username <your-username> $ cibopath config github.token <your-access-token>
可以通过以下方式查看配置文件的内容:
$ cibopath -v config --list
获取模板信息
使用github身份验证后,现在需要获取有关 可用的CookieCutter模板。cibopath将数据作为json文件转储到 磁盘。您可以通过用户配置或cli指定目标位置。
将转储文件位置保存到设置:
$ cibopath config templates.file ~/.cibopath/templates.json $ cibopath -v update
或者在cli上指定:
$ cibopath -v update --dump-file ~/.cibopath/templates.json
请注意,尽管不是必需的,-v或--verbose标志是 如果你想看看Cibopath在引擎盖下做了什么,那就非常有用了。
在模板中搜索关键字
一旦您收集了有关CookieCutter模板的信息,就可以使用 cibopath在模板“readme文件中搜索关键字。
假设您想知道哪些支持django和docker。
$ cibopath search django docker
如果之前没有保存templates.file,则需要显式传递 发送给cli:
$ cibopath search django docker --load-file ~/.cibopath/templates.json
cibopath将按照字母顺序显示匹配模板的列表 以及相应的github存储库url。如果你喜欢这些 模板满足您对新项目的要求,请继续并传递url 到Cookiecutter开始。
cookiecutter-django................. https://github.com/pydanny/cookiecutter-django django-docker-bootstrap............. https://github.com/legios89/django-docker-bootstrap
显示模板信息
cibopath还为您提供有关给定模板的附加信息:
$ cibopath info cookiecutter-pytest-plugin
信息包括name,author,repository以及context, 它将被Cookiecutter用来生成项目。
Name: cookiecutter-pytest-plugin Author: pytest-dev Repository: https://github.com/pytest-dev/cookiecutter-pytest-plugin Context: { "docs_tool": [ "mkdocs", "sphinx", "none" ], "email": "raphael@hackebrot.de", "full_name": "Raphael Pierzina", "github_username": "hackebrot", "license": [ "MIT", "BSD-3", "GNU GPL v3.0", "Apache Software License 2.0" ], "module_name": "{{ cookiecutter.plugin_name|lower|replace('-', '_') }}", "plugin_name": "foobar", "pytest_version": "2.8.1", "short_description": "A simple plugin to use with Pytest", "version": "0.1.0", "year": "2015" }
许可证
根据BSD 3-Clause License的条款分布,cibopath是免费的 以及开源软件
行为准则
在cibopath项目的代码库中进行交互的每个人,发布追踪器,聊天 房间和邮件列表应遵循PyPA Code of Conduct。