Created
February 8, 2017 13:43
-
-
Save girisagar46/f9cc39fd6d8736ac05b1dd953fd6e261 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import os | |
r = requests.get("https://api.github.com/orgs/CSIT-GUIDE/repos") | |
print ("Number of repositories in the organization: ", len(r.json())) | |
repo_list= [] | |
for index in range(len(r.json())): | |
repo = r.json()[index] | |
repo_list.append(repo.get("clone_url")) | |
repo_dict = dict(enumerate(repo_list)) | |
print("------",repo_dict) | |
for k, v in repo_dict.items(): | |
print("Choice: ", k , " URL: ", v) | |
choice = int(input("Which repository you want to clone? ")) | |
print(choice) | |
if(choice): | |
choice_url = repo_dict.get(choice) | |
print(choice_url) | |
#command = "git clone "+choice_url | |
#os.system(command) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment