Let's automate it

This commit is contained in:
wilsonfreitas
2021-04-12 06:58:43 -03:00
parent 6ff5514cec
commit 22d4cd60b3
2 changed files with 47 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
import os
from github import Github
# using an access token
g = Github(os.environ['GITHUB_ACCESS_TOKEN'])
u = g.get_user('kernc')
print(u)
r = u.get_repo('backtesting.py')
print(r)
print(r.html_url)
print(r.archived)
print(r.description)
print(r.updated_at)
r.language
# https://github.com/kernc/backtesting.py
# for ix, repo in enumerate(g.get_user().get_repos()):
# print(ix+1, repo.name)
# repo.edit(has_wiki=False)
# to see all the available attributes and methods
# print(dir(repo))
+24
View File
@@ -0,0 +1,24 @@
import os
from github import Github
# using an access token
g = Github(os.environ['GITHUB_ACCESS_TOKEN'])
# ts = g.search_topics('trading')
# for t in ts:
# print(t)
# t = ts[0]
# print(t)
# print(t.name)
# print(t.updated_at)
# print(t.score)
topic = 'quant'
repos = g.search_repositories(query=f'topic:{topic}')
for repo in repos:
if repo.stargazers_count < 1000:
break
print(repo.name, repo.stargazers_count, repo.language, repo.html_url, repo.description, repo.updated_at, repo.archived)