open-services-group / scrum

SCRUM issues and user stories
GNU General Public License v3.0
0 stars 2 forks source link

collect basic metrics via graphql #29

Closed schwesig closed 1 year ago

schwesig commented 2 years ago
schwesig commented 2 years ago

/triage accpeted /kind metrics /area monitoring

sesheta commented 2 years ago

@schwesig: The label(s) triage/accpeted, kind/metrics, area/monitoring cannot be applied, because the repository doesn't have them.

In response to [this](https://github.com/open-services-group/scrum/issues/29#issuecomment-1199116648): >/triage accpeted >/kind metrics >/area monitoring Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
schwesig commented 2 years ago

/kind feature

sesheta commented 2 years ago

@schwesig: The label(s) kind/website, kind/marketing, area/monitoring, kind/metrics cannot be applied, because the repository doesn't have them.

In response to [this](https://github.com/open-services-group/scrum/issues/29#issuecomment-1199494831): >/kind website >/kind feature >/kind marketing >/area monitoring >/kind metrics >/triage accepted Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
schwesig commented 2 years ago
date: 2022-08-14 Repository Name Created Date Language Stars Watchers Forks Open Issues
operate-first/apps 2020-09-24T07:13:57Z Python 29 29 113 73
operate-first/operations 2020-09-30T13:33:11Z None 19 19 23 34
operate-first/operate-first.github.io-old 2020-09-01T08:31:44Z JavaScript 18 18 43 1
operate-first/ai-for-cloud-ops 2022-02-14T16:12:00Z Python 12 12 4 2
operate-first/blueprint 2020-11-03T11:15:31Z None 8 8 14 3
operate-first/operate-first-data-science-community 2021-11-02T23:09:43Z Jupyter Notebook 7 7 9 17
operate-first/continuous-deployment 2020-08-26T08:30:29Z Dockerfile 7 7 15 0
operate-first/community 2021-05-12T08:55:08Z Jupyter Notebook 6 6 0 86
operate-first/hetzner-baremetal-openshift 2020-12-09T10:27:48Z YAML 5 5 2 0
operate-first/operate-first.github.io 2022-04-27T06:20:31Z JavaScript 4 4 18 52
operate-first/common 2021-06-29T13:04:58Z None 4 4 53 5
operate-first/peribolos-as-a-service 2022-02-25T13:15:04Z TypeScript 3 3 10 25
operate-first/hitchhikers-guide 2021-08-05T10:56:37Z Jupyter Notebook 3 3 8 1
operate-first/community-handbook 2021-07-08T15:10:47Z None 3 3 4 22
operate-first/curator-operator 2022-02-22T15:37:14Z Go 2 2 8 21
operate-first/curator 2021-02-02T19:55:43Z Python 2 2 8 1
operate-first/continuous-delivery 2020-09-14T10:31:42Z Open Policy Agent 2 2 10 1
operate-first/operate-first-in-action 2022-04-06T12:06:43Z None 1 1 6 1
operate-first/opfcli 2021-05-17T16:01:40Z Go 0 0 9 4
operate-first/operate-first-twitter 2021-04-25T22:21:32Z None 0 0 13 0
operate-first/odh-manifests 2022-02-17T17:53:04Z Shell 0 0 5 1
operate-first/odh-dashboard 2020-11-03T09:01:17Z JavaScript 0 0 1 0
operate-first/ionos-openshift 2022-03-21T19:04:28Z None 0 0 1 3
operate-first/installplan-operator 2021-03-19T15:59:08Z Python 0 0 3 0
operate-first/example-acm-install 2021-03-25T14:08:52Z None 0 0 0 0
operate-first/espresso-series 2021-04-29T09:33:05Z Python 0 0 4 0
operate-first/blog 2022-04-21T10:51:28Z JavaScript 0 0 8 0
operate-first/argocd-apps 2020-11-20T15:45:09Z None 0 0 15 0
operate-first/alerts 2021-03-17T15:16:07Z None 0 0 4 0
operate-first/alertmanager-github-receiver 2021-07-16T15:32:07Z None 0 0 3 1
schwesig commented 2 years ago

req: PyGithub

import requests
from prettytable import PrettyTable
from prettytable import MSWORD_FRIENDLY

table = PrettyTable()
table.field_names = ["Repository Name", "Created Date", "Language", "Stars", "Watchers", "Forks", "Open Issues"]

github_username  = "operate-first"   #specify your User name

#api url to grab public user repositories
api_url = f"https://api.github.com/users/{github_username}/repos"

#send get request
response = requests.get(api_url)

#get the json data
data =  response.json()

for repository in data:
    name = repository["full_name"]
    created_date = repository["created_at"]
    language = repository["language"]
    stars = repository["stargazers_count"]
    watchers = repository["watchers_count"]
    forks = repository["forks_count"]
    openissues = repository["open_issues_count"]

    table.add_row([name, created_date, language, stars, watchers, forks, openissues])

table.sortby = "Stars"
table.reversesort = True
table.set_style(MSWORD_FRIENDLY)

print(table)
schwesig commented 2 years ago

see also data in https://github.com/operate-first/operate-first.github.io/pull/180