知行编程网知行编程网  2022-05-12 13:00 知行编程网 隐藏边栏 |   抢沙发  4 
文章评分 0 次,平均分 0.0

如何在Github上精准地找到想要的开源项目?

如何在Github上精准地找到想要的开源项目?
作者 | 觉非
链接 | juejin.im/post/5e3d01c56fb9a07c91100801
编辑 | 深度学习这件小事
很多的小伙伴,经常会有这样的困惑,我看了很多技术的学习文档、书籍、甚至视频,我想动手实践,于是我打开了GitHub,想找个开源项目,进行学习,获取项目实战经验。这个时候很多小伙伴就会面临这样的问题:“我不会搜啊,我该怎么找呀?”,最终只能放弃。
相信看完这篇文章,你就可以学会如何精准地在GitHub搜索项目。

   开源项目的组成部分

在讲清楚之前呢,我们先来了解一下一个开源项目有哪些组成部分:
  • name: 项目名

  • description: 项目的简要描述

  • 项目的源码

  • README.md: 项目的详细情况的介绍

那么除了这些要素之外,项目本身的star数和fork数,也是评判一个开源项目是否火热的标准,这同时也是一个很重要的搜索标准。另外我们也要注意观察这个项目的最近更新日期,因为项目越活跃,那么它的更新日期也更加频繁。
以上要素就是我们在进行搜索的时候要注意的一些关键点。

   如何搜索

那我们到底如何搜索呢?
假设我们现在要搜索React,相信大部分小伙伴都是直接在搜索框里输入:“React”,然后一回车,你就会发现情况像下面这样:
搜索结果会显示非常多的开源项目,简直让你应接不暇,无从下手,很多小伙伴搜到这一步就放弃了,因为项目太多了,根本找不到如何找到自己感兴趣的开源项目,所以这样搜索非常的不准确。所以我们来学习一下稍微精确一点的搜索方法。

按照 name 搜索

搜索项目名里面包含React的项目:
<section style="padding: 0.5em;font-size: 12px;color: white;line-height: 15px;border-radius: 0px;background-color: rgb(51, 51, 51);display: block;font-family: Consolas, Inconsolata, Courier, monospace;overflow: auto;word-spacing: -3px;letter-spacing: 0px;margin-left: 8px;margin-right: 8px;overflow-wrap: normal !important;word-break: normal !important;"><span style="font-size: inherit;color: rgb(252, 194, 140);line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;">in</span>:<span style="font-size: inherit;color: rgb(252, 194, 140);line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;">name</span> React<br style="font-size: inherit;color: inherit;line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;"  /></section>
得到如下结果:
可以看到,这些搜索结果都是项目名里面带有“React”关键字的项目,但是项目数量依旧很多。
现在我们来约束一下
比如我再精确到项目的star数大于5000+:
<section style="padding: 0.5em;font-size: 12px;color: white;line-height: 15px;border-radius: 0px;background-color: rgb(51, 51, 51);display: block;font-family: Consolas, Inconsolata, Courier, monospace;overflow: auto;word-spacing: -3px;letter-spacing: 0px;margin-left: 8px;margin-right: 8px;overflow-wrap: normal !important;word-break: normal !important;"><span style="font-size: inherit;color: rgb(252, 194, 140);line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;">in</span>:<span style="font-size: inherit;color: rgb(252, 194, 140);line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;">name</span> React stars:><span style="font-size: inherit;color: rgb(211, 99, 99);line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;">5000</span><br style="font-size: inherit;color: inherit;line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;"  /></section>
结果是这样的:
搜索结果瞬间精确了很多,现在只有114个项目可供选择。当然我们一般不会把star数设置得这么高,一般设置个1000就差不多了。
同理,我们也可以按照fork的数量来进行搜索:
<section style="padding: 0.5em;font-size: 12px;color: white;line-height: 15px;border-radius: 0px;background-color: rgb(51, 51, 51);display: block;font-family: Consolas, Inconsolata, Courier, monospace;overflow: auto;word-spacing: -3px;letter-spacing: 0px;margin-left: 8px;margin-right: 8px;overflow-wrap: normal !important;word-break: normal !important;"><span style="font-size: inherit;color: rgb(252, 194, 140);line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;">in</span>:<span style="font-size: inherit;color: rgb(252, 194, 140);line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;">name</span> React stars:><span style="font-size: inherit;color: rgb(211, 99, 99);line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;">5000</span> forks:><span style="font-size: inherit;color: rgb(211, 99, 99);line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;">3000</span><br style="font-size: inherit;color: inherit;line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;"  /></section>
你会发现,结果越来越精确!

按照 README 来搜索

搜索README.md里面包含React的项目:
<section style="padding: 0.5em;font-size: 12px;color: white;line-height: 15px;border-radius: 0px;background-color: rgb(51, 51, 51);display: block;font-family: Consolas, Inconsolata, Courier, monospace;overflow: auto;word-spacing: -3px;letter-spacing: 0px;margin-left: 8px;margin-right: 8px;overflow-wrap: normal !important;word-break: normal !important;"> <span style="font-size: inherit;color: rgb(252, 194, 140);line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;">in</span>:readme React<br style="font-size: inherit;color: inherit;line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;"  /></section>
结果有这么多,那么我们再限制一下它的star数和fork数:
<section style="padding: 0.5em;font-size: 12px;color: white;line-height: 15px;border-radius: 0px;background-color: rgb(51, 51, 51);display: block;font-family: Consolas, Inconsolata, Courier, monospace;overflow: auto;word-spacing: -3px;letter-spacing: 0px;margin-left: 8px;margin-right: 8px;overflow-wrap: normal !important;word-break: normal !important;"><span style="font-size: inherit;color: rgb(252, 194, 140);line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;">in</span>:readme React stars:>3000 forks:>3000<br style="font-size: inherit;color: inherit;line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;"  /></section>
搜索结果一下子精确到了90个。这个时候你再去选择项目,就会变得容易很多。

按照 descriptin 搜索

假设我们现在要学习微服务的项目,我们搜索项目描述(description)里面包含微服务的项目:
<section style="padding: 0.5em;font-size: 12px;color: white;line-height: 15px;border-radius: 0px;background-color: rgb(51, 51, 51);display: block;font-family: Consolas, Inconsolata, Courier, monospace;overflow: auto;word-spacing: -3px;letter-spacing: 0px;margin-left: 8px;margin-right: 8px;overflow-wrap: normal !important;word-break: normal !important;"><span style="font-size: inherit;color: rgb(252, 194, 140);line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;">in</span>:description 微服务<br style="font-size: inherit;color: inherit;line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;"  /></section>
结果有这么多,那我们接着增加一些筛选条件:
<section style="padding: 0.5em;font-size: 12px;color: white;line-height: 15px;border-radius: 0px;background-color: rgb(51, 51, 51);display: block;font-family: Consolas, Inconsolata, Courier, monospace;overflow: auto;word-spacing: -3px;letter-spacing: 0px;margin-left: 8px;margin-right: 8px;overflow-wrap: normal !important;word-break: normal !important;"><span style="font-size: inherit;color: rgb(252, 194, 140);line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;">in</span><span style="font-size: inherit;color: inherit;line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;">:description</span> 微服务 <span style="font-size: inherit;color: rgb(252, 194, 140);line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;">language</span><span style="font-size: inherit;color: inherit;line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;">:python</span> <br style="font-size: inherit;color: inherit;line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;"  /></section>
language:python的意思是我们把语言限制为python,我们来看看结果如何:
搜索结果精确了很多。
假如在这些项目里面,我们想要找到最近才更新的项目,意思是更新时间就在最近,我们可以这样:
<section style="padding: 0.5em;font-size: 12px;color: white;line-height: 15px;border-radius: 0px;background-color: rgb(51, 51, 51);display: block;font-family: Consolas, Inconsolata, Courier, monospace;overflow: auto;word-spacing: -3px;letter-spacing: 0px;margin-left: 8px;margin-right: 8px;overflow-wrap: normal !important;word-break: normal !important;"><span style="font-size: inherit;color: rgb(252, 194, 140);line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;">in</span><span style="font-size: inherit;color: inherit;line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;">:description</span> 微服务 <span style="font-size: inherit;color: rgb(252, 194, 140);line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;">language</span><span style="font-size: inherit;color: inherit;line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;">:python</span> <span style="font-size: inherit;color: rgb(252, 194, 140);line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;">pushed</span>:>2020<span style="font-size: inherit;color: rgb(252, 194, 140);line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;">-01-01</span><br style="font-size: inherit;color: inherit;line-height: inherit;overflow-wrap: inherit !important;word-break: inherit !important;"  /></section>
pushed:>2020-01-01的意思是我们把项目的最后更新时间限制到2020-01-01,我们来看看结果如何:
搜索结果只有8个了,这几个项目就属于更新比较活跃的项目,这下再也不纠结了。

   总结

好,我们来总结一下。我们想要进行精准搜索,无非就是增加筛选条件。
  1. in:name xxx // 按照项目名搜索
  2. in:readme xxx // 按照README搜索
  3. in:description xxx // 按照description搜索
那么在这里面呢,我们又可以增加筛选条件
  1. stars:>xxx // stars数大于xxx
  2. forks:>3000 // forks数大于xxx
  3. language:xxx // 编程语言是xxx
  4. pushed:>YYYY-MM-DD // 最后更新时间大于YYYY-MM-DD
以上就是我们在GitHub上面精准搜索项目的一些小技巧,希望对你有所帮助!
<pre style="max-width: 100%;letter-spacing: 0.544px;text-align: center;box-sizing: border-box !important;overflow-wrap: break-word !important;"><section style="margin-right: 8px;margin-left: 8px;max-width: 100%;white-space: normal;color: rgb(0, 0, 0);font-family: -apple-system-font, system-ui, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;widows: 1;line-height: 1.75em;box-sizing: border-box !important;overflow-wrap: break-word !important;"><strong style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="max-width: 100%;letter-spacing: 0.5px;font-size: 14px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><strong style="max-width: 100%;font-size: 16px;letter-spacing: 0.544px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="max-width: 100%;letter-spacing: 0.5px;box-sizing: border-box !important;overflow-wrap: break-word !important;">—</span></strong>完<strong style="max-width: 100%;font-size: 16px;letter-spacing: 0.544px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="max-width: 100%;letter-spacing: 0.5px;font-size: 14px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><strong style="max-width: 100%;font-size: 16px;letter-spacing: 0.544px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="max-width: 100%;letter-spacing: 0.5px;box-sizing: border-box !important;overflow-wrap: break-word !important;">—</span></strong></span></strong></span></strong></section><section style="max-width: 100%;white-space: normal;font-family: -apple-system-font, system-ui, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;letter-spacing: 0.544px;widows: 1;box-sizing: border-box !important;overflow-wrap: break-word !important;"><section powered-by="xiumi.us" style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><section style="margin-top: 15px;margin-bottom: 25px;max-width: 100%;opacity: 0.8;box-sizing: border-box !important;overflow-wrap: break-word !important;"><section style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><section style="max-width: 100%;letter-spacing: 0.544px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><section powered-by="xiumi.us" style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><section style="margin-top: 15px;margin-bottom: 25px;max-width: 100%;opacity: 0.8;box-sizing: border-box !important;overflow-wrap: break-word !important;"><section style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><section style="margin-right: 8px;margin-bottom: 15px;margin-left: 8px;padding-right: 0em;padding-left: 0em;max-width: 100%;color: rgb(127, 127, 127);font-size: 12px;font-family: sans-serif;line-height: 25.5938px;letter-spacing: 3px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="max-width: 100%;color: rgb(0, 0, 0);box-sizing: border-box !important;overflow-wrap: break-word !important;"><strong style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="max-width: 100%;font-size: 16px;font-family: 微软雅黑;caret-color: red;box-sizing: border-box !important;overflow-wrap: break-word !important;">为您推荐</span></strong></span></section><p style="margin-right: 8px;margin-bottom: 5px;margin-left: 8px;padding-right: 0em;padding-left: 0em;max-width: 100%;min-height: 1em;color: rgb(127, 127, 127);font-size: 12px;font-family: sans-serif;line-height: 1.75em;letter-spacing: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;">一文通俗了解对抗生成网络(GAN)核心思想<br style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"  /></p><section style="margin-bottom: 5px;max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="max-width: 100%;font-size: 14px;box-sizing: border-box !important;overflow-wrap: break-word !important;">MIT最新深度学习入门课,安排起来!</span><br style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"  /></section><p style="margin-right: 8px;margin-bottom: 5px;margin-left: 8px;padding-right: 0em;padding-left: 0em;max-width: 100%;min-height: 1em;color: rgb(127, 127, 127);font-size: 12px;font-family: sans-serif;line-height: 1.75em;letter-spacing: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;">图深度学习入门难?这篇教程帮你理清楚了脉络<br style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"  /></p><p style="margin-right: 8px;margin-bottom: 5px;margin-left: 8px;padding-right: 0em;padding-left: 0em;max-width: 100%;min-height: 1em;font-family: sans-serif;line-height: 1.75em;letter-spacing: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;">2020年最值得学习的9大数据分析在线免费课程<br style="max-width: 100%;box-sizing: border-box !important;overflow-wrap: break-word !important;"  /></p><p style="margin-right: 8px;margin-bottom: 5px;margin-left: 8px;padding-right: 0em;padding-left: 0em;max-width: 100%;min-height: 1em;color: rgb(127, 127, 127);font-size: 12px;font-family: sans-serif;line-height: 1.75em;letter-spacing: 0px;box-sizing: border-box !important;overflow-wrap: break-word !important;"><span style="max-width: 100%;-webkit-tap-highlight-color: rgba(0, 0, 0, 0);cursor: pointer;font-size: 14px;box-sizing: border-box !important;overflow-wrap: break-word !important;">深度学习必懂的13种概率分布</span></p></section></section></section></section></section></section></section></section>

如何在Github上精准地找到想要的开源项目?

本篇文章来源于: 深度学习这件小事

本文为原创文章,版权归所有,欢迎分享本文,转载请保留出处!

知行编程网
知行编程网 关注:1    粉丝:1
这个人很懒,什么都没写

发表评论

表情 格式 链接 私密 签到
扫一扫二维码分享