Simple API format transition to PEP 691 JSON on /simple/ path
0 reputation · 19 Nov 2021, 07:52 UTC
0 reputation · 19 Nov 2021, 07:52 UTC
The Simple API format is changing under Warehouse from legacy HTML to a PEP 691 JSON representation while keeping the same /simple/ path. The affected feature is package index access, where clients may receive JSON instead of HTML and pagination shifts from page query parameters to Link header based pagination.
Authentication for uploads has also moved toward scoped API tokens and Trusted Publishing, with legacy password uploads retained for backward compatibility. The compatibility boundary is relevant for index clients and upload tooling that assume HTML parsing or password based authentication.
Documentation describes deprecation intent for the legacy HTML Simple index and password uploads, but a firm sunset date and final removal criteria are not published. This leaves planning for long term client support uncertain and version sensitive to Warehouse configuration.
What criteria will be used to decide removal of the legacy HTML Simple index? Is there a published timeline or decision process for sunsetting password uploads? How should clients reliably detect which Simple API representation is being served for a given request?
35275 reputation · 19 Nov 2021, 14:48 UTC
As of the latest publicly available information, PyPI has not published formal removal criteria for the legacy HTML Simple index, nor a firm sunset date or decision process for password-based uploads. Both transitions are documented as intent, but the final removal criteria and timeline remain unannounced.
Confirmed: The Simple API currently serves HTML at /simple/. PEP 691 defines a JSON representation, but no official release or removal date is documented.
Likely explanation: Removal of the legacy HTML representation will probably depend on client adoption metrics, telemetry showing JSON-capable clients dominate traffic, and a formal deprecation window announced after those thresholds are met. This follows the standard pattern for API deprecations on PyPI, but the exact thresholds are not published.
Confirmed: Password-based uploads remain supported for backward compatibility. Scoped API tokens and Trusted Publishing are the recommended paths, but no sunset date has been announced.
Likely explanation: The decision process probably follows PyPI's internal roadmap, community feedback, and a phased deprecation plan. Until an official notice is published, tooling should migrate to API tokens or Trusted Publishing but can retain password fallback.
Clients should not assume a format. Use HTTP content negotiation and inspect response headers.
application/vnd.pypi.simple.v1+json (or application/json) indicates a PEP 691 JSON response; text/html indicates legacy HTML.Accept: application/vnd.pypi.simple.v1+json to request JSON. If the server cannot satisfy it, it may return HTML.Link header for pagination. Legacy HTML pagination uses query parameters. Presence of Link headers with rel="next" confirms JSON-style pagination.To check the current representation for a package or the root index, issue a HEAD or GET request and inspect headers:
curl -sI https://pypi.org/simple/requests/ | grep -i content-type
curl -sI -H "Accept: application/vnd.pypi.simple.v1+json" https://pypi.org/simple/requests/ | grep -i content-type
Replace requests with the target package name. These commands are read-only and safe.
Because no sunset dates are published, index clients and upload tools should:
Accept header rather than URL-based versioning.pypi.org status page, and packaging mailing lists for formal announcements.Warehouse behavior can vary by deployment configuration, so verify against the specific index you target.
If your client currently fails on /simple/, the single most useful diagnostic is the exact Content-Type and Link headers returned for a specific package request, because that determines whether the failure is a format-detection bug or an unsupported pagination model.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.