Skip to content

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

Closed

Description

@pfmoore

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).

Activity

  1. pradyunsg commented on May 7, 2022

    @pradyunsg
    Member

    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/"
     },
    
  2. added
    infraCore infrastructure for building and rendering PEPs
    on May 7, 2022
  3. pradyunsg commented on May 7, 2022

    @pradyunsg
    Member

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

  4. pfmoore commented on May 7, 2022

    @pfmoore
    MemberAuthor

    Awesome! That provides everything I need, thanks 🙂

  5. pradyunsg commented on May 7, 2022

    @pradyunsg
    Member

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

  6. AA-Turner commented on May 7, 2022

    @AA-Turner
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    infraCore infrastructure for building and rendering PEPs

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions