Code Monkey home page Code Monkey logo

michaelcurrin / github-reporting-py Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 2.0 353 KB

Create detailed and summary CSV reports of activity by a GitHub user, using the GraphQL API ๐Ÿ‘จโ€๐Ÿ’ป ๐Ÿ“Š ๐Ÿ

Home Page: https://michaelcurrin.github.io/github-reporting-py

License: MIT License

Python 96.87% Shell 0.63% Makefile 2.50%
python python3 graphql github-api github-graphql reporting-tool requests github-api-v4 github-graphql-api graphql-api

github-reporting-py's Introduction

GitHub Reporting Tool ๐Ÿ‘จโ€๐Ÿ’ป ๐Ÿ“Š ๐Ÿ

Create detailed and summary CSV reports of activity by a GitHub user, using the GraphQL API

GitHub tag License

Made with Python API - GitHub GraphQL

Purpose

This tool was created to:

  • Explore the GitHub GraphQL API for fun.
  • Output CSV reports around repos, users and commits - all within a target GH user or organization.
  • Act as a wrapper on requests and formatting, so you can focus on writing or using a query and getting the data out as a CSV.
  • Act an easy CLI for anyone - without caring about what language the tool is implemented in (other than installing initially).

Documentation

View docs

Contributing

If you want to make the project better, see the contribution guidelines.

License

Released under MIT by @MichaelCurrin.

github-reporting-py's People

Contributors

michaelcurrin avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

isaac-defrain

github-reporting-py's Issues

Fix type issues

ghgql/config.py:6: error: Library stubs not installed for "yaml" (or incompatible with Python 3.9)
ghgql/config.py:6: note: Hint: "python3 -m pip install types-PyYAML"

ghgql/demo/variables.py:24: error: Library stubs not installed for "requests" (or incompatible with Python 3.9)
ghgql/demo/basic.py:13: error: Library stubs not installed for "requests" (or incompatible with Python 3.9)
ghgql/demo/basic.py:13: note: Hint: "python3 -m pip install types-requests"
ghgql/demo/basic.py:13: note: (or run "mypy --install-types" to install all missing stub packages)
ghgql/demo/basic.py:13: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports

ghgql/lib/__init__.py:10: error: Library stubs not installed for "requests" (or incompatible with Python 3.9)
ghgql/lib/__init__.py:11: error: Skipping analyzing "jinja2": found module but no type hints or library stubs

Found 5 errors in 4 files (checked 19 source files)
make: *** [typecheck] Error 1

Add paging to query.py

Also update usage doc.

See code such as

repo_page_info = repositories['pageInfo']
        if repo_page_info['hasNextPage']:
            variables['cursor'] = repo_page_info['endCursor']
        else:
            break

Test against queries with and without pageInfo in their output.
If cursor/after is provided in variables (or some flag to prevent paging esp on first page), then do not do automatic paging.

Consider how the output looks (printing data as you go or joining data in a larger file and then writing).

Also see if this is even needed. The paging is handled specifically in other Python scripts, where the case is not general.

Download repos

Get the ZIP URL for owned repos and starred repos.

Write to a text file.

Use rsync or similar to bulk download.

Maybe spin off as a separate project, but find a way to reduce the GraphQL overhead without copy and pasting code. Like find library or make this reuseable.

See Trello notes.

Create new extended PR report

Create an new PR report GQL query and parse the results.

Use the existing reports but parameterize them. Process for a given list of repos or simply the last 50 repos by last update (more than that caused load issues in the explorer).

Required output fields below.

Metadata

  • Ower
  • Repo name
  • PR author
  • PR created
  • PR updated
  • PR status
  • PR status changed
  • PR Target branch
  • PR Source branch
  • Latest commit date
  • Latest commit author
  • First commit date
  • First commit author
  • Jira ticket number
  • PR full description (body)
  • PR URL

Metrics

  • Commit count
  • Changed files
  • Added lines
  • Deleted lines
  • Changed lines
  • Comments

Users and reviews

  • Merged By

  • Reviewers

  • Review

  • Approved

  • Review Dismissed

  • Review Changes Requested

  • Review Commented

Create PR report

Create a PR CSV report which queries named repos and outputs stats in a single CSV.

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.