File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,31 @@ for Python 3 (You have pip, right?) to install it::
61
61
python3 -m pip install ghreq
62
62
63
63
64
+ Example
65
+ =======
66
+
67
+ .. code :: python
68
+
69
+ from ghreq import Client
70
+
71
+ with Client(token = " your-api-token-here" ) as client:
72
+ user = client.get(" /user" )
73
+ print (" I am user" , user[" login" ])
74
+ print ()
75
+
76
+ print (" Here are my repositories:" )
77
+ for repo in client.paginate(" /user/repos" ):
78
+ print (repo[" full_name" ])
79
+ print ()
80
+
81
+ hello_world = client / " repos" / " octocat" / " Hello-World"
82
+ details = hello_world.get()
83
+ print (f " { details[' full_name' ]} has been starred { details[' stargazers_count' ]} times. " )
84
+ print (" Here is the first page of its open issues & PRs:" )
85
+ for issue in (hello_world / " issues" ).get():
86
+ print (f " # { issue[' number' ]} : { issue[' title' ]} " )
87
+
88
+
64
89
API
65
90
===
66
91
You can’t perform that action at this time.
0 commit comments