Differences between revisions 14 and 15
Revision 14 as of 2014-10-03 09:41:44
Size: 1414
Editor: PaulMoore
Comment:
Revision 15 as of 2018-07-10 16:42:32
Size: 1482
Editor: EWDurbin
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
For most up to date documetation, see https://warehouse.readthedocs.io/api-reference/json/
Line 6: Line 7:

.
`http://pypi.python.org/pypi/<package_name>/json`

 . `http://pypi.python.org/pypi/<package_name>/json`
Line 14: Line 11:

.
`http://pypi.python.org/pypi/<package_name>/<version>/json`

 . `http://pypi.python.org/pypi/<package_name>/<version>/json`
Line 21: Line 14:

Line 37: Line 28:

PyPI APIs: Simple, JSON, XMLRPC.

For most up to date documetation, see https://warehouse.readthedocs.io/api-reference/json/

You can access JSON information about packages by using the URL format

  • http://pypi.python.org/pypi/<package_name>/json

This retrieves information about the latest stable release (using PEP 386 ordering, falling back on older distutils ordering where packages are not PEP 386 compliant.) If you wish to retrieve information about a specific release you may use

  • http://pypi.python.org/pypi/<package_name>/<version>/json

You can use this to automatically generate a link to the latest release of your package with (assuming use of jQuery):

<span id="release_info" class="note">Download:
  <a href="http://pypi.python.org/pypi/roundup">latest</a></span>
<script type="text/javascript">
 $.getJSON('http://pypi.python.org/pypi/roundup/json?callback=?', function(data) {
     h = 'Download: ' + data.info.version;
     for (var i=0, url; url=data.urls[i]; ++i) {
       h += '<br><a href="' + url.url + '">' + url.filename + '</a>';
     }
     $('#release_info').html(h);
 });
</script>

sphinxcontrib-cheeseshop Sphinx extension that adds link to latest package version to docs by including HTML code that uses JSON API above.

PyPIJSON (last edited 2020-08-31 15:40:46 by JoshCooley)

Unable to edit the page? See the FrontPage for instructions.