Giter VIP home page Giter VIP logo

github-stats-collector's Introduction

GitHub Stats Collector Build Status

Collect repository statistics, issues and comments for all repositories in a GitHub organization. It also clones and analyzes the codebase for certain properties like lines of code. All information is stored in a line-delimited JSON file where each repository is a JSON object.

Usage

npm install -g @mapbox/github-stats-collector

Dependencies

git needs to be able to ssh clone all your repositories in GitHub.

Make sure you have cloc installed with brew install cloc or npm install -g cloc. This is used to count single lines of code in your repos. Make sure you expose a GITHUB_ACCESS_TOKEN with access to your repository data.

export GITHUB_ACCESS_TOKEN=23adfxadfasdf...

Fetch Stats

Fetch all repositories and store them in a file.

collect-repos -u mapbox -o repos.json

Fetch GitHub statistics for all repos in the input file and store them in a new JSON file.

collect-repo-stats -i repos.json -o repos.json

Pitfalls:

  • This will hammer the GitHub API to get statistics about your repositories. If you have more than a thousand repos you will hit the GitHub API rate limit
  • If you have very large repositories the cloning will timeout and you won't get code statistics
  • The GitHub API does not always have the statistics ready but will only start to calculate them once you request them. The program tries to retry operations until it get's statistics. However GitHub might not populate the cache fast enough. Just run it a second time afterwards when GitHub has populated the statistics cache.

github-stats-collector's People

Contributors

lukasmartinelli avatar

Stargazers

 avatar  avatar

Watchers

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