Skip to content

This repository contains scripts for using Github API to create repo, delete repo, create an issue, close an issue, etc.

Notifications You must be signed in to change notification settings

GaganpreetKaurKalsi/Github-APIs-Python

Repository files navigation

Calling Github API using Python 🐍😎❤

Documentation - https://developer.github.com/v3/

Scripts are written in Python3 🐍

  • Create a repository
  • Delete a repository
  • Create an issue
  • Comment on an issue
  • Close an issue
  • Create a pull request
  • Create reaction for an issue
  • Delete reaction for an issue - You will get the reaction id from the json response file obtained when making a request for reaction list for an issue.
  • List reactions for an issue
  • Get repository topics
  • List repository languages
  • List repos for an Authenticated User
  • List repos of a User - Any user across Github

Note : Tokens are like passwords, they cannot be shared. Replace the Token with your own generated token to make the code work. Also run output.json() to get the json response file from which you can extract data using for loop.

How to generate a token ❓❔❓❔

  1. Go to Settings (Top rightmost dropdown near profile pic)
  2. Go to Developer settings
  3. Go to Personal access tokens
  4. Click Generate new token
  5. Confirm password to continue
  6. Fill the Note field with anything
  7. Select scopes (what you want the Github api to access and control in your Github account)
  8. Click Generate token
Note : The token will only be visible to you for once. Afterwards it won't be visible. If you forget the token then you have to Regenerate it and update the token everywhere it is in use.