Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a supported API/method for getting a list of PEP numbers and their titles? #2583

Closed
pfmoore opened this issue May 7, 2022 · 5 comments
Labels
infra Core infrastructure for building and rendering PEPs

Comments

@pfmoore
Copy link
Member

pfmoore commented May 7, 2022

I have an app which lists all the PEP numbers and their descriptions. I had been scraping the PEP index, as that was the only way I could find in the past. But recent changes to the PEP rendering broke my scraper, and I feel like it's probably not a good idea to simply fix it and move on - I'd rather find something more reliable.

Is there any web API, or just a URL pointing to a document with a stable structure, that lets me get a list like I describe? I can't fetch the PEP index from this repo, because it's built on demand, and the nature of the application where I need the data means I can only realistically do a URL fetch (grabbing the repo and doing a build isn't feasible).

@pradyunsg
Copy link
Member

pradyunsg commented May 7, 2022

https://peps.python.org/api/peps.json exists. It's considered "experimental" but it does provide all the PEP metadata/information. With PEP 8, for example:

 "8": {
  "title": "Style Guide for Python Code",
  "authors": "GvR, Warsaw, Coghlan",
  "discussions_to": null,
  "status": "Active",
  "type": "Process",
  "created": "05-Jul-2001",
  "python_version": null,
  "post_history": "05-Jul-2001, 01-Aug-2013",
  "resolution": null,
  "requires": null,
  "replaces": null,
  "superseded_by": null,
  "url": "https://peps.python.org/pep-0008/"
 },

@pradyunsg pradyunsg added the infra Core infrastructure for building and rendering PEPs label May 7, 2022
@pradyunsg
Copy link
Member

It only provides the headers though, and not the contents of each of the rendered PEPs.

@pfmoore
Copy link
Member Author

pfmoore commented May 7, 2022

Awesome! That provides everything I need, thanks 🙂

@pradyunsg
Copy link
Member

Neato, closing since I reckon this is resolved. :)

@AA-Turner
Copy link
Member

xref #2584 for documenting the file.

A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infra Core infrastructure for building and rendering PEPs
Projects
None yet
Development

No branches or pull requests

3 participants