pydriller

Python Framework to analyse Git repositories

https://github.com/ishepard/pydriller

Science Score: 59.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 1 DOI reference(s) in README
  • Academic publication links
    Links to: acm.org
  • Committers with academic emails
    2 of 37 committers (5.4%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.0%) to scientific vocabulary

Keywords

git mining-software-repositories msr python python-framework python3 software-engineering
Last synced: 6 months ago · JSON representation

Repository

Python Framework to analyse Git repositories

Basic Info
Statistics
  • Stars: 893
  • Watchers: 18
  • Forks: 151
  • Open Issues: 11
  • Releases: 46
Topics
git mining-software-repositories msr python python-framework python3 software-engineering
Created almost 8 years ago · Last pushed 6 months ago
Metadata Files
Readme Funding License

README.md

Build Status Documentation Status codecov Downloads License

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

```python

from pydriller import Repository

for 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.

TestPulse

If you are interested in tests, tests health and code quality, test code coverage, etc..., you might be interested in our new project: TestPulse! Check it out: https://www.testpulse.io

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

Pre-requisites

  • First clone the repository: git clone https://github.com/ishepard/pydriller.git cd pydriller
  • (Optional) It is suggested to make use of virtualenv. Therefore, before installing the requirements run: python3 -m venv venv source venv/bin/activate
  • Then, install PyDriller's requirements: pip install -r requirements.txt
  • For executing the test suite, extract the test repositories and install the test requirements: unzip test-repos.zip pip install -r test-requirements.txt
  • For linting and type checking, install the development requirements pip install -r dev-requirements.txt

Testing

(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.

Run the test suite with pytest:

pytest

Run the test suite with a coverage report as terminal output:

pytest --cov-report term --cov=pydriller tests/

alternatively run:

make testcoverage

Type checking

PyDriller source code is annotated for type checking, see syntax. The mypy type checker is executed on each pull request. That is, code that does not type check will not pass that build step, see CI step. Run the type checker locally:

mypy --ignore-missing-imports pydriller/ tests/

alternatively run:

make typecheck

Linting

PyDriller relies on the Flake8 linter to check and enforce code style. The linter is executed on each pull request. That is, code that does not conform to code style rules as formulated by Flake8, will not pass that build step, see CI step. Run the type checker locally:

flake8

alternatively run:

make lint

CodeQL

PyDriller's CI chain executes a set of CodeQL queries related to Python quality and security. Currently, a local CodeQL setup is quite big (>1.7GB) and require multiple setup and configuration steps. Therefore, it is omitted here and in the Makefile.

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.

Owner

  • Name: Davide Spadini
  • Login: ishepard
  • Kind: user
  • Location: London, UK
  • Company: Meta

Software Engineer at Meta, working on Testing Infra of WhatsApp.

GitHub Events

Total
  • Create event: 1
  • Issues event: 10
  • Release event: 2
  • Watch event: 51
  • Issue comment event: 16
  • Push event: 6
  • Pull request review comment event: 12
  • Pull request review event: 5
  • Pull request event: 6
  • Fork event: 11
Last Year
  • Create event: 1
  • Issues event: 10
  • Release event: 2
  • Watch event: 51
  • Issue comment event: 16
  • Push event: 6
  • Pull request review comment event: 12
  • Pull request review event: 5
  • Pull request event: 6
  • Fork event: 11

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 697
  • Total Committers: 37
  • Avg Commits per committer: 18.838
  • Development Distribution Score (DDS): 0.333
Past Year
  • Commits: 68
  • Committers: 10
  • Avg Commits per committer: 6.8
  • Development Distribution Score (DDS): 0.471
Top Committers
Name Email Commits
ishepard s****e@g****m 465
stefanodallapalma s****0@g****m 66
Davide Spadini d****i@m****m 36
Arie van Deursen a****n@t****l 16
Davide Spadini d****i@f****m 14
NullConvergence a****n@c****l 13
HelgeCPH r****f@i****k 10
Ha h****t@c****o 9
butterl l****0@1****m 6
Marco Castelluccio m****o@m****m 6
Yibo Yan t****q@o****m 6
stefanodallapalma s****0@g****m 5
k----n k****n 4
Kang Hong Jin k****n@g****m 4
James Goodwin j****9@g****m 3
Gregor Lato g****o@g****m 3
Christoph Gote c****e@e****h 3
Alex 3****e 3
andodet a****t@g****m 2
Ondrej Tethal o****l@o****m 2
Luca Pascarella l****a@g****m 2
cmtg c****t@u****r 2
Evan Casey e****y@a****m 2
Ledenel l****i@g****m 2
Shantanu Oak s****k@g****m 1
12f23eddde 1****e@g****m 1
Stephane Poss s****s@g****m 1
Thomas Trummer t****r@g****m 1
Dominik Tuchyna d****a@r****m 1
Finn Kalvelage f****e@p****e 1
and 7 more...
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 94
  • Total pull requests: 60
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 6 days
  • Total issue authors: 79
  • Total pull request authors: 30
  • Average comments per issue: 3.43
  • Average comments per pull request: 2.07
  • Merged pull requests: 49
  • Bot issues: 0
  • Bot pull requests: 2
Past Year
  • Issues: 7
  • Pull requests: 15
  • Average time to close issues: 11 days
  • Average time to close pull requests: 15 days
  • Issue authors: 7
  • Pull request authors: 6
  • Average comments per issue: 1.0
  • Average comments per pull request: 2.73
  • Merged pull requests: 12
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • ishepard (5)
  • hatrg (3)
  • stefanodallapalma (3)
  • corneliusroemer (2)
  • cp3-three (2)
  • Vela-zz (2)
  • S3j5b0 (2)
  • josemorenoo (2)
  • mohmehmo (2)
  • armandossrecife (2)
  • cedric-audy (1)
  • thtrummer (1)
  • Knniff (1)
  • n-bes (1)
  • razi-rechan (1)
Pull Request Authors
  • stefanodallapalma (10)
  • HelgeCPH (7)
  • ishepard (5)
  • IP1102 (4)
  • hatrg (3)
  • abdulxs (2)
  • otethal (2)
  • BaumiCoder (2)
  • mauricioaniche (2)
  • BrenoFariasdaSilva (2)
  • VelaYF (2)
  • totoroyyb (1)
  • cmtg (1)
  • gliptak (1)
  • xtuchyna (1)
Top Labels
Issue Labels
PR welcome (17) enhancement (11) bug (5) good first issue (3)
Pull Request Labels
dependencies (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 167,548 last-month
  • Total docker downloads: 6
  • Total dependent packages: 12
  • Total dependent repositories: 230
  • Total versions: 48
  • Total maintainers: 1
pypi.org: pydriller

Framework for MSR

  • Versions: 48
  • Dependent Packages: 12
  • Dependent Repositories: 230
  • Downloads: 167,548 Last month
  • Docker Downloads: 6
Rankings
Downloads: 0.5%
Dependent packages count: 1.0%
Dependent repos count: 1.0%
Average: 2.2%
Stargazers count: 2.3%
Forks count: 4.2%
Docker downloads count: 4.3%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/publish.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • pypa/gh-action-pypi-publish release/v1 composite
.github/workflows/codeql.yml actions
  • actions/checkout v3 composite
  • github/codeql-action/analyze v2 composite
  • github/codeql-action/autobuild v2 composite
  • github/codeql-action/init v2 composite
.github/workflows/continuous-integration-workflow.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • codecov/codecov-action v1 composite
requirements.txt pypi
  • gitpython *
  • lizard *
  • pytz *
  • types-pytz *
test-requirements.txt pypi
  • psutil * test
  • pytest * test
setup.py pypi
docs/requirements.txt pypi
  • sphinx_rtd_theme *