根据您感兴趣的存储库建议github存储库的工具。
gitsuggest的Python项目详细描述
一个根据您显示的存储库建议github存储库的工具 对…感兴趣。
这里发生了什么事?
Programs must be written for people to read, and only incidentally for machines to execute. ~ Hal Abelson
成为一个更好的程序员的一个快速方法是阅读smart编写的代码 人。github使查找这样的代码/存储库变得容易。一天结束时 我们都对自己的特定领域感兴趣,我们通过 “星光”存储库和/或“跟随”对这些内容做出贡献的人员 储存库。
这是一个工具,它使用您所标记的存储库和存储库 你所关注的那些人已经开始帮助你发现 你可能会感兴趣。
有多快?
这完全取决于你拥有的存储库的数量,以及你关注的人的数量 已经主演了。根据这个数字,可能需要一分钟到 两分钟给你建议的存储库列表。
设置
使用pip
pip install gitsuggest
直接从存储库
git clone --recursive https://github.com/csurfer/gitsuggest.git python gitsuggest/setup.py install
设置后
如果你看到一个stopwords错误,这意味着你没有语料库 停止字从NLTK下载。您可以使用下面的命令下载它。
python -c "import nltk; nltk.download('stopwords')"
用法
作为命令
# For help with usage gitsuggest --help # With just username in command to provide password secretly gitsuggest <username> # Password can be skipped which means you chose to go the unauthenticated # way which may raise RateLimitExceeded exception. To skip password enter # nothing when prompted for password and press enter. # NOTE: Using it this way generates a static html page with the search # results. This gets opened it in your default browser. # To fetch better suggestions at the cost of extra time and calls gitsuggest <username> --deep_dive # Without the --deep_dive flag we limit the suggestion to consider only # the repositories you have starred. With --deep_dive we also consider # repositories which people you follow have starred.
作为模块
fromgitsuggestimportGitSuggest# To use with username password combinationgs=GitSuggest(username=<username>,password=<password>)# To use with access_tokengs=GitSuggest(token=access_token)# To use without authenticatinggs=GitSuggest(username=<username>)# To use with deep dive flaggs=GitSuggest(username=<username>,password=<password>,token=None,deep_dive=True)gs=GitSuggest(token=access_token,deep_dive=True)gs=GitSuggest(username=<username>,deep_dive=True)# To get an iterator over suggested repositories.gs.get_suggested_repositories()
常见问题解答
为什么我们需要验证(使用密码)才能获得建议,我浏览 Gihub一直都没有认证?
你没有。从v0.0.4 使用密码进行身份验证,但要知道通过api访问github的是 高速率限制,对于未经验证的请求,当 与认证的比较。有关ratelimits的详细信息。
这意味着在没有密码(未经验证)的情况下使用时 失败,出现ratelimiteexceeded异常。