Skip to main content

Calculate code contribution metrics for git repositories

Project description

Git-truckfactor

Git-truckfactor is a library that assits in the analysis of git repositories. It allows for calculation of Truck Factor scores and code contribution metrics.

The tool closely resembles the algorithm proposed by Avelino et al. to estimate the Truck Factor.

Installation

Get the latest version by running:

pip install git-truckfactor

Dependencies

Git-truckfactor requires the following python libraries:

In addition git-truckfactor makes use of the ruby library Linguist. That means you will also need Ruby installed.

Usage

The git-truckfactor package is intended to be used as a module.

  1. Import the module into the python environment:

    import git_truckfactor
  2. Clone git repository

    command:

    git_truckfactor.clone_repository(<github_repository_url>, <local_repository_path>)

    example:

    git_truckfactor.clone_repository('https://github.com/pandas-dev/pandas.git', './github_repos/pandas')

    returns: local_repository_path

  3. Calculate truckfactor

    command:

    git_truckfactor.truck_factor_repo(<local_repository_path>, <cur_wd>, <start_date>, <end_date>)

    example:

    cur_wd = os.getcwd()
    git_truckfactor.truck_factor_repo('./github_repos/pandas', cur_wd, '2020-01-01', '2021-01-01')

    returns: truckfactor score + creates a directory ‘truckfactor_results’ with truck factor statistics stored in a CSV-file

See the demo.ipynb file for examples on how to use git-truckfactor for multiple repositories.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git-truckfactor-0.1.1.tar.gz (21.8 kB view details)

Uploaded Source

File details

Details for the file git-truckfactor-0.1.1.tar.gz.

File metadata

  • Download URL: git-truckfactor-0.1.1.tar.gz
  • Upload date:
  • Size: 21.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

File hashes

Hashes for git-truckfactor-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7a80296d1e8a0aeed6ccbd7a04968400ea5807c3724dbb2b2d7d5e97f5f3ba4f
MD5 569b0cb5bbc3074ae25634a0f9644245
BLAKE2b-256 1d3f937f62811a788d602bcc9b711f67a440a407dbc1746b0479102b9c2532f6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page