Giter VIP home page Giter VIP logo

pr-stats's Introduction

PrStats

This is a simple command line tool to compute some metrics of pull requests on a GitHub repository inside a time span.

Development environment

Install pip and virtualenv.

Create a new virtual environment:

virtualenv bin

Activate the environment:

source env/bin/activate

Install the requirements:

pip install -r requirements.txt

Usage

Currently only username/password authentication is implemented so you will need to provide your GitHub credentials in the environment

export GITHUB_USERNAME=edofic
export GITHUB_PASSWORD=supersecret password

And then supply repository name, start date, and end date

python main.py google/ggrc-core "2015-12-29T00:00:00Z" "2016-02-12T00:00:00Z"

This will dump JSON formatted stats to the console.

AWS Lambda

You can also package this tool as an AWS Lambda function. For this you will need to provide a prst_config.py file - see prst_config.sample and then run make dist or make dockerdist for a completely isolated built.

The prst_config.py contains an aditional parameter: put_url. If present, the lambda will HTTP PUT the results to the given url after it's done.

Viewing the results

The view folder contains a very simple Angular.js based renderer for the results. It is a static page and takes URL to stats as a query string. Example:

python main.py google/ggrc-core "2015-12-29T00:00:00Z" "2016-02-12T00:00:00Z" >> stats
python -m SimpleHTTPServer . &
open "http://localhost:8000/view/public/?%2Fstats"

pr-stats's People

Contributors

edofic avatar nejczupec avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.