• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PyDriller: PyDriller 是一个可以帮助开发人员解析 Git 存储库的 Python 框架,开发 ...

原作者: [db:作者] 来自: Gitee 收藏 邀请

Build StatusDocumentation StatuscodecovDownloadsLanguage grade: PythonLicense

PyDriller

PyDriller is a Python framework that helps developers in analyzing Git repositories. With PyDriller you can easily extract information about commits, developers, modified files, diffs, and source code.

Install

pip install pydriller

Quick usage

from pydriller import Repositoryfor commit in Repository('https://github.com/ishepard/pydriller').traverse_commits():    print(commit.hash)    print(commit.msg)    print(commit.author.name)    for file in commit.modified_files:        print(file.filename, ' has changed')

Read the docs for more usage examples.Furthermore, a video is available on Youtube.

How to cite PyDriller

@inproceedings{Spadini2018,  address = {New York, New York, USA},  author = {Spadini, Davide and Aniche, Maur\'{i}cio and Bacchelli, Alberto},  booktitle = {Proceedings of the 2018 26th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering - ESEC/FSE 2018},  doi = {10.1145/3236024.3264598},  isbn = {9781450355735},  keywords = {2018,acm reference format,and alberto bacchelli,davide spadini,git,gitpython,maur\'{i}cio aniche,mining software repositories,pydriller,python},  pages = {908--911},  publisher = {ACM Press},  title = {{PyDriller: Python framework for mining software repositories}},  url = {http://dl.acm.org/citation.cfm?doid=3236024.3264598},  year = {2018}}

How to contribute

First clone the repository:

git clone https://github.com/ishepard/pydriller.gitcd pydriller

(Optional) It is suggested to make use of virtualenv. Therefore, before installing the requirements run:

python3 -m venv venvsource venv/bin/activate

Then, install the requirements:

pip install -r requirements.txt

(Important) I tend to not accept Pull Requests without tests, so:

  • unzip the test-repos.zip zip file
  • inside are many "small repositories" that were manually created to test PyDriller. Use one of your choice to test your feature (check the existing tests for inspiration)
  • if none is suitable for testing your feature, create a new one. Be careful: if you create a new one, do not forget to upload a new zip file test-repos.zip that includes your new repository, otherwise the tests will fail.

To run the tests (using pytest):

unzip test-repos.zippip install -r test-requirements.txtpytest

Acknowledgements

This project has received funding from the European Union's Horizon 2020 research and innovation programme under the Marie Sklodowska-Curie grant agreement No. 642954.


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
objective-git: Objective-C bindings to libgit2发布时间:2022-02-13
下一篇:
gitinspector: 发布时间:2022-02-13
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap