从命令行中搜索github

githsearch的Python项目详细描述


https://img.shields.io/pypi/dm/githsearch.svg

GithSearch

从命令行快速搜索github

安装

pipinstallgithsearch

用作命令行工具

options:-hor--help:displayinstructions-ror--repo[args]:searchforargsingithubrepos-uor--user[args]:searchforargsingithubusers-lor--limit:knowyourratelimitexample:githsearch-rpythontetrissampleoutput:-->https://github.com/davidcollins4481/tetris-clone--TetrisCloneinPython(PyGame)-->https://github.com/zxmarcos/pytrix--TetriscloneinPython+PyGame-->https://github.com/nickcrafford/python-pygame-tetris--QuickanddirtyTetrisclonewrittentolearnPygame.-->https://github.com/davepgreene/tetris-clone--ATetrisclonewritteninPythonwithpygame

(另外:线条以紫色交替出现,非常可爱)

以编程方式使用githsearch

您可以搜索回购协议或用户。 首先实例化主类,然后搜索repo调用get_repo,并将要搜索的术语作为参数传递:

>>>fromgithsearchimportGithSearch>>>g=GithSearch()>>>g.get_repo('python tetris clone pygame')[('https://github.com/davidcollins4481/tetris-clone','Tetris Clone in Python (PyGame)'),('https://github.com/zxmarcos/pytrix','Tetris clone in Python + PyGame'),('https://github.com/nickcrafford/python-pygame-tetris','Quick and dirty Tetris clone written to learn Pygame.'),('https://github.com/davepgreene/tetris-clone','A Tetris clone written in Python with pygame'),('https://github.com/AndreiMarks/BlindBlocks','Tetris Clone written in Python 3.2 using Pygame 1.9.2'),('https://github.com/dannyburrows/PoorMansTetris','A Tetris clone, using python and pygame'),...]

搜索输出最相关的结果。 搜索用户是相同的,但请改为调用get_user

>>>g.get_user('test')[('test','https://github.com/test'),('prinnotamago','https://github.com/prinnotamago'),('diannt','https://github.com/diannt'),('73153','https://github.com/73153'),('ssweetin','https://github.com/ssweetin'),('deekoder','https://github.com/deekoder'),('songkang666','https://github.com/songkang666'),('ArdentZeal','https://github.com/ArdentZeal'),('gitmobiletest','https://github.com/gitmobiletest'),...]

但是请注意,githsearch使用github搜索api的免费配额,因此有一个速率限制。您可以拨打电话咨询:

>>>g.get_limit{'remaining':10,'reset':1453497872,'limit':10}

只要你不破坏api,你就应该没事的。

更改:

2016年2月:添加了命令行工具refactoring,将readme从markdown改为restructuredtext,以便在pypi上看起来更好。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何转换apache。cfx。OmeElement的头对象   java无法从SpringSource工具套件2.8.1热部署到GlassFish 3.1   从聊天中删除用户的阵列(Java)   JAVA木卫一。在安卓中解压缩时发生FileNotFoundException   java如何在活动和其他Activity创建的线程之间进行通信   java使用TimeUnit在更改JavaFX标签文本之间休眠   使用hibernate在MySql数据库表中实现java行级锁定   nextLine()扫描仪java无法正常工作(可能是因为Unicode)   java HSQLDB 2.4如何使用UNIX_MILLIS()作为BIGINT列的默认值   java如何为媒体卷更改注册ContentObserver?   JAVA木卫一。IOException:在salesforce上插入数据时,不活动的原因是必需的   java跨越了可观察对象发出的值   java在使用try and catch时播放声音