public
Description: Python interface for talking to the github API
Clone URL: git://github.com/dustin/py-github.git
Lots of documentation.
dustin (author)
Sat May 24 12:48:21 -0700 2008
commit  30659ad20a090751efa902a5a9db405c96fc8291
tree    f9af0f96726d97516d3494689b96cc841ef32437
parent  0942fc3164237e73dcdceddb66eef452849e2b7a
...
8
9
10
11
 
 
 
12
13
14
...
39
40
41
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
8
9
10
 
11
12
13
14
15
16
...
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
0
@@ -8,7 +8,9 @@ of my projects. Included is githubsync.py which does that for any given user
0
 (within the limitations of the github API, which currently limits you to public
0
 projects).
0
 
0
-## Example
0
+# Supported APIs
0
+
0
+## User
0
 
0
 This code (which happens to be main in git.py)
0
 
0
@@ -39,3 +41,41 @@ Yields this result:
0
       http://github.com/dustin/environ
0
       git://github.com/dustin/environ.git
0
 
0
+## Search
0
+
0
+Search for repos or descriptions matching the given search terms.
0
+
0
+ repos = GitHub().search('memcache')
0
+ for r in repos:
0
+ print "%s has %d forks and %d watchers" % (
0
+ r.name, r.forks, r.watchers)
0
+
0
+## Commits
0
+
0
+Get the recent commits for a given repo.
0
+
0
+ commits = GitHub().commits('dustin', 'py-github')
0
+ for c in commits:
0
+ print "%s: %s" % (c.id[:7], c.message.split('\n')[0])
0
+
0
+Also, you may specify a particular branch:
0
+
0
+ commits = GitHub().commits('dustin', 'memcached', 'binary')
0
+ for c in commits:
0
+ print "%s: %s" % (c.id[:7], c.message.split('\n')[0])
0
+
0
+## Commit
0
+
0
+Fetch a specific commit and lots of details about it.
0
+
0
+Note there is a *lot* of structured data in here this example doesn't show.
0
+For example, modified files contain a full diff of each file, and every commit
0
+has a list of parent IDs (in the case of an octopus merge, there can be many).
0
+If you want more information, it's quite likely there.
0
+
0
+ commit = GitHub().commit('gitmirror', 'git', 'c998ae9b')
0
+ print "%s made the change\n%s\nAffecting the following files:" % (
0
+ commit.author.name, commit.message)
0
+ for c in commit.added: print "A", c.filename
0
+ for c in commit.removed: print "R", c.filename
0
+ for c in commit.modified: print "M", c.filename
...
2
3
4
 
 
 
 
 
 
 
 
 
5
6
7
...
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
0
@@ -2,6 +2,15 @@
0
 """
0
 Interface to github's API.
0
 
0
+Basic usage:
0
+
0
+g = GitHub()
0
+
0
+for r in g.search('memcache'):
0
+ print r.name
0
+
0
+See the GitHub docs or README.markdown for more usage.
0
+
0
 Copyright (c) 2007 Dustin Sallings <dustin@spy.net>
0
 """
0
 

Comments

    No one has commented yet.