-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
20 lines (16 loc) · 780 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import requests
response = requests.get(
"https://api.github.com/search/repositories?q=language:python+stars:%3E1&sort=stars&order=desc")
response.raise_for_status()
data = response.json()["items"]
with open("open-source.txt", "w", encoding="utf-8") as file:
file.write("Open source GitHub Repositories with Python language:\n\n")
for repo in data:
owner_url = repo["owner"]["html_url"]
description = repo["description"]
name = repo["name"]
file.write(f"\n Name: {name}\n"
f" Description: {description}\n"
f" Owner url: {owner_url} \n\n")
file.write(
"-------------------------------------------------------------------------------------------------------------------\n\n")