Skip to content

Commit e38d731

Browse files
committed
ADDED: draft for github connection
1 parent 52163a0 commit e38d731

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/main.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
from datetime import datetime
55
import argparse
66
import os
7+
from github import Github
8+
from github import Auth
79

810

911
def 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+
256278
def main():
257279
args = parse_arguments()
258280
if args.is_verbose:
259281
print_summary(args)
282+
model = build_model(args)
260283

261284

262285
if __name__ == "__main__":

0 commit comments

Comments
 (0)