bugit - github repo bulk download


In [1]:
from github import Github
import os
import random
import git
import getpass
import socket

In [2]:
g = Github()

In [3]:
gitlist = []

In [4]:
def gitusr(gitn):
    for repo in g.get_user(gitn).get_repos():
        print repo.name
        gitlist.append(repo.name)

In [5]:
thehost = socket.gethostname()

In [6]:
theuser = getpass.getuser()

In [7]:
theuser


Out[7]:
'wcmckee'

In [8]:
gitusr('wcmckee')


4chan-API
adypy
anim_framework
art-lastfm
artcontrol-api
AsylumJamCrushGame
autopaintpy123
bacongamejam05
battlenet
bbc2wp
BeOk
bgj05-hungry
BirdCage
brobeur-static
brobeur-web
BroBeurFishingDream
broLove
clint
cobal.eportfolio
compohub
DailyProgBot
DeltaBot
dockerfiles
flask
flask-ghpages-example
ggj14
hackage-server
hamiltoncomputerclub.org.nz
haskell-learn
HTML5-Tiny
html5lib-python
iamagamer
ihaskell-notebook
imgur-python
intercity
intro_programming
ipython
ipython-docker
ipython-hydra
LD48-Skins
marshmallow
massive-wright
Minecraft
miniprojects
molyjam2013
niketa
opencompetencies
openfaux-server
ouya-unity-plugin
paintingautopy
pithos
prodo-game
Projects
puphpet
pyatakl
pybackupz
pyladies
pymel
python-guide
python-pandora
python-patterns
pytm
pyunderdog
pywp-post
raspi
RasPiWrite
RedditPress
reddit_bot
redtube
RPIO
selfspy
SketchDaily-GestureDrawing
skins
SortPictures
SoundWall
SuburbNightmare
te-whare-o-te-ata
TPB
Triger
tweepy
UnityLuaIntegration
vagrantboxes-heroku
vIPer
wcmckee-notebook
wcmckee.com
wcmckee.github.io
wcmStringPY
wirepil
xboxdrv

In [9]:
%%bash 
./job.sh


bash: line 1: ./job.sh: No such file or directory

In [10]:
os.mkdir('/home/' + theuser + '/github')


---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-10-7e202c0b555d> in <module>()
----> 1 os.mkdir('/home/' + theuser + '/github')

OSError: [Errno 17] File exists: '/home/wcmckee/github'

In [11]:
os.chdir('/home/' + theuser + '/github')

In [12]:
for gi in gitlist:
    print gi
    git.Git().clone('https://github.com/wcmckee/' + gi)


4chan-API
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-12-3f6ac075b28f> in <module>()
      1 for gi in gitlist:
      2     print gi
----> 3     git.Git().clone('https://github.com/wcmckee/' + gi)

AttributeError: 'module' object has no attribute 'Git'

In [13]:
git.


  File "<ipython-input-13-bf157b8d6ec1>", line 1
    git.
        ^
SyntaxError: invalid syntax

In [14]:
import git
git.Git().clone("https://github.com/wcmckee/pyatakl")


---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-14-17e85e0acaab> in <module>()
      1 import git
----> 2 git.Git().clone("https://github.com/wcmckee/pyatakl")

AttributeError: 'module' object has no attribute 'Git'

In [15]:
git.Blob()


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-15-d4140aa0dd9e> in <module>()
----> 1 git.Blob()

TypeError: __init__() takes at least 2 arguments (1 given)

In [15]:


In [ ]: