We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4bc64f3 commit cf9964bCopy full SHA for cf9964b
Github Size-Contributor-List/script.py
@@ -0,0 +1,27 @@
1
+import requests
2
+import argparse
3
+
4
+def main(args):
5
+ GITHUB_URL = f" https://api.github.com/repos/{args.o}/{args.n}"
6
+ res = requests.get(GITHUB_URL).json()
7
+ response_collaborators = requests.get(f"{GITHUB_URL}/contributors").json()
8
9
+ response_text = f"Size of repository is {res.get('size')}"
10
11
+ list_of_contributors = []
12
13
+ for x in response_collaborators:
14
+ list_of_contributors.append(x.get("login"))
15
16
+ with open("output.txt", "w") as text:
17
+ text.write(response_text + "\n" + "List of contributors is as follows: " + str(list_of_contributors))
18
19
20
+if __name__ == "__main__":
21
+ parser = argparse.ArgumentParser("This script displays the size and list of contributors for a specific repo")
22
+ parser.add_argument("-o", help="The name of the user", type=str, required=True)
23
+ parser.add_argument("-n", help="The name of the repo", type=str, required=True)
24
25
+ args = parser.parse_args()
26
27
+ main(args)
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments