如何解析来自 GitHub API JSON 响应的信息?

How to parse information from GitHub API JSON response?

我想找到一种方法来解析从 GitHub REST API 接收到的 this JSON。我正在尝试解析 Python.

中响应中所有回购协议的每个描述

类似于下面的内容:

  • 对 URL

    执行 HTTP GET
  • 如果状态代码正常 - 将数据转换为字典列表并从每个字典中提取信息

      import requests
      r = requests.get('https://api.github.com/users/ariv797/repos')
      if r.status_code == 200:
        data = r.json()
        desc_lst = [e['description'] for e in data]
        print(desc_lst)
    

输出

['Python script for bookmyshow', 'Fidellity is a voice assistant app built using fluttter', 'Flutter package for Open Weather API integration', 'Hogwarts (Harry Potter) open sandbox game made in Unity', 'Datasets of SpaceX rockets, launches, satellites, cores, ships and more.', 'Simple extension to remove audio ads on Spotify web player', 'Just scrapes the latest version of popular programming languages']