Skip to content

Instantly share code, notes, and snippets.

@GINK03
Created October 3, 2025 12:54
Show Gist options
  • Save GINK03/321659717f4e3c5aabdb1491efe9cdf4 to your computer and use it in GitHub Desktop.
Save GINK03/321659717f4e3c5aabdb1491efe9cdf4 to your computer and use it in GitHub Desktop.
fetch_peps.py
# /// 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