用于提取软件存储库元数据的包

llnl-scraper的Python项目详细描述


刮刀

scraper是一个工具,用于从各种 代码托管平台,例如:github.com、github enterprise、gitlab.com, 托管Gitlab和Bitbucket服务器。

入门:code.gov

Code.gov是美国联邦政府新推出的一个网站 政府允许人们从政府习惯中获取元数据 开发的软件。这个站点需要元数据才能运行,而这个python 图书馆可以帮忙!

要开始,您需要一个GitHub Personal Auth Token 向github api发出请求。这应该在您的环境中设置,或者 shell rc文件名为GITHUB_API_TOKEN

$ export GITHUB_API_TOKEN=XYZ

$ echo "export GITHUB_API_TOKEN=XYZ" >> ~/.bashrc

此外,要执行工时估计,您需要安装 cloc进入你的环境。这通常使用Package Manager完成,例如 npmhomebrew

然后要为您的代理生成一个code.json文件,您需要一个 config.json文件,用于协调要连接和擦除的平台 数据来自。示例配置文件可以在demo.json中找到。一次 你有你的配置文件,你准备好安装和运行刮刀!

# Install Scraper
$ pip install -e .

# Run Scraper with your config file ``config.json``
$ scraper --config config.json

生成的code.json文件的完整示例可以是found here

配置文件选项

配置文件是一个json文件,用于指定存储库平台 从中提取项目以及一些可用于覆盖的设置 通过刮削返回的数据不完整或不准确。

基本结构是:

{#REQUIRED"contact_email":"...",#Usedwhenthecontactemailcannotbefoundotherwise#OPTIONAL"agency":"...",#Youragencyabbreviationhere"organization":"...",#Theorganizationwithintheagency"permissions":{...},#ObjectcontainingdefaultvaluesforusageTypeandexemptionText#Platformconfigurations,describedinmoredetailbelow"GitHub":[...],"GitLab":[...],"Bitbucket":[...],}
"GitHub":[{"url":"https://github.com",#GitHub.comorGitHubEnterpriseURLtoinventory"token":null,#PrivatetokenforaccessingthisGitHubinstance"public_only":true,#Onlyinventorypublicrepositories"orgs":[...],#Listoforganizationstoinventory"repos":[...],#Listofsinglerepositoriestoinventory"exclude":[...]#Listoforganizations/repositoriestoexcludefrominventory}],
"GitLab":[{"url":"https://gitlab.com",#GitLab.comorhostedGitLabinstanceURLtoinventory"token":null,#PrivatetokenforaccessingthisGitHubinstance"fetch_languages":false,#IncludeindividualcallstoAPIforlanguagemetadata.Veryslow,sodefaultstofalse.(eg,for191projectsoninternalserver,5secondsforFalse,12minutes,38secondsforTrue)"orgs":[...],#Listoforganizationstoinventory"repos":[...],#Listofsinglerepositoriestoinventory"exclude":[...]#Listofgroups/repositoriestoexcludefrominventory}]
"Bitbucket":[{"url":"https://bitbucket.internal",#BaseURLforaBitbucketServerinstance"username":"",#Usernametoauthenticatewith"password":"",#Passwordtoauthenticatewith"exclude":[...]#Listofprojects/repositoriestoexcludefrominventory}]
"TFS":[{"url":"https://tfs.internal",#BaseURLforaTeamFoundationServer(TFS)orVisualStudioTeamServices(VSTS)orAzureDevOpsinstance"token":null,#PrivatetokenforaccessingthisTFSinstance"exclude":[...]#Listofprojects/repositoriestoexcludefrominventory}]

许可证

scraper是根据麻省理工学院的许可证发布的。有关详细信息,请参见 LICENSE文件。

LLNL-代码-705597

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

推荐PyPI第三方库


热门话题
junit有没有办法在Java中重新初始化静态类?   在浏览器中点击应用程序时java Play框架挂起   文件Java错误中的NullPointerException   使用Java中的SNMP查找网络中计算机的登录名   java包装服务器引导程序已弃用,有什么替代方案?   当客户在等待理发时,java信号量值是否存在问题?   java如何使用JavaMail仅下载特定类型的附件   如何在java中将十进制转换为十六进制   java Slick2D粒子系统不会生成粒子   java检测更改事件来自何处   将Java集合类型参数类设置为数组   java如何从eclipse导出为可运行JAR文件?   java EntityManager对象未注入Glassfish和Spring   swing从actionPerformed和actionListener Java返回字符串   java在给定另一个等价键对象的情况下获取映射项的当前键   无论输入如何,java网络都会产生相同的输出