Skip to content

Commit

Permalink
fixup! Document the PEPs API
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Jul 14, 2024
1 parent 2b110f3 commit 9376788
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pep_sphinx_extensions/pep_zero_generator/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,13 @@ def write_pep0(
self.emit_newline()
self.emit_newline()

self.emit_title("API")
self.emit_text(
"The `PEPS API <api/peps.json>`__ is a JSON file of metadata about "
"all the published PEPs. :doc:`Read more here <api/index>`."
)
self.emit_newline()

# PEPs by category
self.emit_title("Index by Category")
meta, info, provisional, accepted, open_, finished, historical, deferred, dead = _classify_peps(peps)
Expand Down
64 changes: 64 additions & 0 deletions peps/api/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
PEPs API
========

There is a read-only API of published PEPs available at:

* https://peps.python.org/api/peps.json

The structure is like:

.. code-block:: json
{
"0": {
"number": 0,
"title": "Index of Python Enhancement Proposals (PEPs)",
"authors": "The PEP Editors",
"discussions_to": null,
"status": "Active",
"type": "Informational",
"topic": "",
"created": "13-Jul-2000",
"python_version": null,
"post_history": null,
"resolution": null,
"requires": null,
"replaces": null,
"superseded_by": null,
"url": "https://peps.python.org/pep-0000/"
},
"1": {
"number": 1,
"title": "PEP Purpose and Guidelines",
"authors": "Barry Warsaw, Jeremy Hylton, David Goodger, Alyssa Coghlan",
"discussions_to": null,
"status": "Active",
"type": "Process",
"topic": "",
"created": "13-Jun-2000",
"python_version": null,
"post_history": "21-Mar-2001, 29-Jul-2002, 03-May-2003, 05-May-2012, 07-Apr-2013",
"resolution": null,
"requires": null,
"replaces": null,
"superseded_by": null,
"url": "https://peps.python.org/pep-0001/"
},
"2": {
"number": 2,
"title": "Procedure for Adding New Modules",
"authors": "Brett Cannon, Martijn Faassen",
"discussions_to": null,
"status": "Active",
"type": "Process",
"topic": "",
"created": "07-Jul-2001",
"python_version": null,
"post_history": "07-Jul-2001, 09-Mar-2002",
"resolution": null,
"requires": null,
"replaces": null,
"superseded_by": null,
"url": "https://peps.python.org/pep-0002/"
}
}

0 comments on commit 9376788

Please sign in to comment.