diff --git a/README.md b/README.md index efd1bae..320d944 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,8 @@ This repository contains my code scripts to automate boring stuff around me. - [set_router_ip](#set_router_ip) - [selenium/send](#selenium/send) - [selenium/gmail](#selenium/gmail) +- [github_repo_creator.py](#github_repo_creator.py) + ### `WhatsApp_img_notes_extractor` @@ -56,4 +58,8 @@ A python script to send messages using WhatsApp web, using selenium. A python script to send emails using the Gmail web interface, using selenium. +### `github_repo_creator.py` + +A python script to create github repo from command line. + Enjoy! diff --git a/github_repo_creator.py b/github_repo_creator.py new file mode 100644 index 0000000..8191a81 --- /dev/null +++ b/github_repo_creator.py @@ -0,0 +1,31 @@ +# Script Name : git_repo_creator.py +# Author : Harish Tiwari +# Created : 2nd October 2020 +# Last Modified : - +# Version : 1.0.0 + +# Modifications : + +# Description : This python script will create a github repo from command line. + +import requests +import json + +user_name = input("Enter your github user name: ") +print(user_name) + +github_token = input("Enter your github tokne: ") +print(github_token) + +repo_name = input("Enter your repo Name: ") +print(repo_name) + +repo_description = input("Enter your repo description: ") +print(repo_description) + +payload = {'name': repo_name, 'description': repo_description, 'auto_init': 'true'} +repo_request = requests.post('https://api.github.com/' + 'user/repos', auth=(user_name,github_token), data=json.dumps(payload)) +if repo_request.status_code == 422: + print("Github repo already exists try wih other name.") +elif repo_request.status_code == 201: + print("Github repo has created successfully.")