从命令行搜索git
gitsearch-cli的Python项目详细描述
Git搜索
搜索github的简单命令行。
简介
git-search
是一个简单的命令行工具,允许您在GitHub中搜索用户和存储库。
安装
要安装git search,可以使用pip
和以下命令;
pip3 install gitsearch-cli
用法
默认情况下,搜索的范围将设置为在存储库中查找,但是您可以更改范围以专门查找用户。
搜索用户
git-search --scope users owen rumney or git-search --scope users owenrumney
这将产生以下结果;
username | url |
---|---|
owenrumney | https://github.com/owenrumney |
搜索存储库
搜索存储库时,可以按关键字创建常规搜索,也可以通过包含语言和/或用户来集中搜索。
git-search -l scala -u apache spark
这将产生以下结果;
name | owner | url |
---|---|---|
fluo-muchos | apache | https://github.com/apache/fluo-muchos |
predictionio | apache | https://github.com/apache/predictionio |
spark | apache | https://github.com/apache/spark |
spark-website | apache | https://github.com/apache/spark-website |
如果只想返回关键字在名称中的结果,可以使用--nameonly
标志
git-search -l scala -u apache spark --nameonly
这将产生以下结果;
name | owner | url |
---|---|---|
spark | apache | https://github.com/apache/spark |
spark-website | apache | https://github.com/apache/spark-website |
基于日期的标准
您可以使用自然日期周期根据创建或更新的日期搜索存储库,下面的所有示例都是可以接受的(不限于此)。如果使用的日期段不可接受,则搜索将使用时间开始(1979-30-10)
git-search -l=scala --updated="last week"# return 30 scala projects updated in the last week git-search -l=python --created="yesterday"# return 30 scala projects created yesterday git-search gitsearch -l=python --created "3 days ago"# return 30 scala projects created yesterday
待办事项
- [X]为搜索条件添加基于日期的选项
- []添加测试
- []重构代码以使其更具pythonic性