Skip to content

Instantly share code, notes, and snippets.

@girisagar46
Created February 8, 2017 13:43
Show Gist options
  • Save girisagar46/f9cc39fd6d8736ac05b1dd953fd6e261 to your computer and use it in GitHub Desktop.
Save girisagar46/f9cc39fd6d8736ac05b1dd953fd6e261 to your computer and use it in GitHub Desktop.
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