Skip to content

github repo creator python script uploaded #6

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down Expand Up @@ -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!
31 changes: 31 additions & 0 deletions github_repo_creator.py
Original file line number Diff line number Diff line change
@@ -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.")