forked from ChristopherMacGown/python-github3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
45 lines (32 loc) · 1.31 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
python-github3
==============
Here are the beginning of a python library to take advantage of the new API. It
is still in development and the interfaces may (read: will) change but is full
featured enough now to be used for most tasks of the new API.
Caveats
-------
This is for the APIv3 featureset. If the stuff in APIv2 is a long time coming
then there is some vague chance of adding support for those features here, but
in general the style of the two versions are rather different so it is somewhat
preferable to limit this to the v3 style.
Examples
--------
from github3 import client
# Build a client with our auth credentials, works with oauth_token
# instead of password.
c = client.Client(username='some_user', password='some_password')
# Most actions (issues and the like) are actions on a repo
repo = client.Repo(c,'repo_user', 'repo_name')
# We use a very pythonic interface to the data, most things act like dicts or
# lists, though the interfaces still need a little massaging
issues = repo.issues()
# Iterate through all the issues, handle pagination for you so may make
# multiple requests.
for x in issues:
print x['title']
# Create a new issue
new_issue = issues.append(title='foo')
# Update that issue
new_issue.update(milestone=1)
# Delete that issue
new_issue.delete()