File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44from datetime import datetime
55import argparse
66import os
7+ from github import Github
8+ from github import Auth
79
810
911def is_file_directory_writable (file_path ):
@@ -253,10 +255,31 @@ def print_summary(args):
253255 print (" No" )
254256
255257
258+ def build_model (args ):
259+ # using an access token
260+ auth = Auth .Token ("access_token" )
261+
262+ # First create a Github instance:
263+
264+ # Public Web Github
265+ g = Github (auth = auth )
266+
267+ # Github Enterprise with custom hostname
268+ g = Github (base_url = "https://{hostname}/api/v3" , auth = auth )
269+
270+ # Then play with your Github objects:
271+ for repo in g .get_user ().get_repos ():
272+ print (repo .name )
273+
274+ # To close connections after use
275+ g .close ()
276+
277+
256278def main ():
257279 args = parse_arguments ()
258280 if args .is_verbose :
259281 print_summary (args )
282+ model = build_model (args )
260283
261284
262285if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments