Created
October 3, 2025 12:54
-
-
Save GINK03/321659717f4e3c5aabdb1491efe9cdf4 to your computer and use it in GitHub Desktop.
fetch_peps.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /// script | |
# requires-python = ">=3.12" | |
# dependencies = [ | |
# "httpx", | |
# "rich", | |
# ] | |
# /// | |
import sys | |
import httpx | |
from rich.pretty import pprint | |
limit = int(sys.argv[1]) if len(sys.argv) > 1 else 10 | |
resp = httpx.get("https://peps.python.org/api/peps.json", timeout=10.0) | |
resp.raise_for_status() | |
data = resp.json() | |
items = [(k, v["title"]) for k, v in data.items()][:limit] | |
pprint(items) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment