-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Document peps.json
and move it to the root
#2584
Comments
cc: @hugovk @CAM-Gerlach |
👍 No need for the /api in the URL, the fact that it's a .json file implies that it's machine readable. |
I don't have a strong opinion, but slightly prefer including https://pypi.org/project/pepotron/ is already using the API, so a move would cause 404s. Although I can fix and release it immediately, and to be honest doubt many people are using it, but it's still a break.
A benefit is we can also have the docs at https://peps.python.org/api/ (for example like https://pypistats.org/api/). |
I would argue that this is the wrong conceptual framing to use -- we are not in the business of providing a full programmatic APIs for PEPs, but simply a representation of the index as a JSON file for easier parsing and use. In this spirit, the suggested I would very much encourage someone to run a "PEP API" service if wanted, but I really don't want to be in the business of anything beyond serving static files in this repo, and I think I'm aware some things would break if we moved the URL, but it was explicitly introduced as experimental and undocumented, so anybody making use of the file is doing so at their own risk -- I don't think breakage should be a big argument here. (It will be a different story when we document it, which is why I'd like to do so sooner rather than later). A |
My opinion isn't that strong either, but I agree with @hugovk in also preferring In any case, before/as part of formally documenting the API, we should provide the data in a more structured, easily-consumable form that is abstracted from that in the source; instead of requiring all tools (including our own) to independently parse the authors, post history, dates, etc. that are each in one of several different non-standard formats. This would allow us to make further changes to the user input format (simplifying it, being more flexible in what we allow, accepting URLs instead of emails for authors, etc) without having to worry about other tools being able to read it easily. It would also help address @AA-Turner 's concerns originally raised on #2358 regarding a lack of structure in the data, difficulty in tools reading it and the format/parsing being tied to reST/Sphinx. In fact, as I've already been thinking about lately and discussed with @JelleZijlstra and @warsaw at PyCon, right now we parse the headers three different places with three different sets of logic, and instead should just use the structured format above (with the parsing presumably in the |
Using the royal "we", are we? 😂
I don't think anyone here is suggesting anything otherwise—a API is just a machine-readable interface to access some data or functionality, and does not require server-side interactivity, and that is exactly what is being proposed here. For example, the FSF API (full disclosure, I'm one of the maintainers) operates in essentially the same way as ours does. What calling something an "API" fundamentally conveys is not a particular mechanism (REST, SOAP, etc) but rather that the data is machine-readable and reasonably stable enough to be used programmatically, which it seems there's already interest in despite not documenting or publicizing this at all. The value is enabling the wider ecosystem being able to easily and reliably consume and enrich PEP metadata for a variety of uses with minimal friction so long as they use what's under
Agreed there, but once we do, keeping anything we expect not to break under |
As someone who's just found out about the JSON file and is now using it rather than scraping the HTML page, I can confirm that all I need is "a representation of the index as a JSON file for easier parsing and use". I really don't care whether you call it that, or an "API". I don't have any preconceptions about what an "API" might be beyond "a representation as a JSON file" - so call it what you like. But please don't remove it just because of terminology. |
Revisiting this.
|
We currently have https://peps.python.org/api/peps.json, an undocumented file.
It seems that people have usecases for the file, even without official support (see #2567, #2583). I suggest moving the file to the root1 for consistency with
peps.rss
and easier discoverability, and simultaneously documenting the file, and the minimum guarantees we provide about it.In the issue that created it, Cam noted:
I think the
api/
is uneeded here -- to those use cases, we could instead generatepeps.python.org/pep-NNNN.json
, andpeps.python.org/authors.json
.I'd be interested in views.
A
Footnotes
i.e. to https://peps.python.org/peps.json ↩
The text was updated successfully, but these errors were encountered: