PEP 691: JSON-based Simple API for Python Package Indexes

My concern with using HTTP headers rather than separate URLs is that it prevents basic/static clients from supporting the JSON API. Currently you can throw some files in a folder with a few index.html files and serve them with Apache, nginx etc., or even put them in GitHub Pages, where there isn’t necessarily control over the headers. There’s no reason you couldn’t do the same with a JSON API, since the metadata is entirely static after the packages have been uploaded. A tool like my simple503 could be used to generate those JSON files automatically.

I realise this is probably a niche usecase, but I do think a simple API should be simple for both the server and the client.

4 Likes