Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

two python scripts updated #21

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
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@
1. **32_stock_scraper.py**: Get stock prices
1. **33_country_code.py**: Convert country code to country name
1. **34_git_all_repos.py**: Clone all repositories from a public user or organization on Github. Usage: `python git_all_repos.py users USER_NAME` or `python git_all_repos.py orgs ORG_NAME`
1. **35_qr_code.py**: Convert user input text to qr code image
1. **36_git_repo_creator.py**: Create github repo from command line.
31 changes: 31 additions & 0 deletions scripts/git_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.")
8 changes: 8 additions & 0 deletions scripts/qr_code.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import pyqrcode
import png
from pyqrcode import QRCode


user_input = raw_input("Enter web page address or info you want to convert into qr code: ")
user_input = pyqrcode.create(user_input)
user_input.png('myqr.png', scale = 6)