Differences between revisions 6 and 17 (spanning 11 versions)
Revision 6 as of 2012-10-18 00:12:01
Size: 1567
Editor: RichardJones
Comment: wiki restore 2013-01-23
Revision 17 as of 2020-08-31 15:40:46
Size: 1505
Editor: JoshCooley
Comment: Update pypi.python.org URLs to HTTPS
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
[[CheeseShopDev|PyPI]] APIs: [[PyPISimple|Simple]], '''JSON''', [[PyPIXmlRpc|XMLRPC]].
Line 2: Line 3:
Note you can also use the [[PyPiXmlRpc|XMLRPC api]].
For most up to date documentation, see https://warehouse.readthedocs.io/api-reference/json/
Line 7: Line 7:

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

 . `https://pypi.python.org/pypi/<package_name>/json`
Line 15: Line 11:

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

 . `https://pypi.python.org/pypi/<package_name>/<version>/json`
Line 23: Line 15:



Line 29: Line 17:
  <a href="http://pypi.python.org/pypi/roundup">latest</a></span>   <a href="https://pypi.python.org/pypi/roundup">latest</a></span>
Line 31: Line 19:
 $.getJSON('http://pypi.python.org/pypi/roundup/json?callback=?', function(data) {  $.getJSON('https://pypi.python.org/pypi/roundup/json?callback=?', function(data) {
Line 40: Line 28:


[[http://sphinx.pocoo.org/|Sphinx]] has support for putting an up-to-date Download link in your website using that JSON with one simple directive, for example (for the "roundup" package):


{{{
.. pypi-release:: Roundup
   :prefix: Download
   :class: note
}}}


See the [[http://pypi.python.org/pypi/sphinxcontrib-cheeseshop|sphinxcontrib-cheeseshop project]] documentation for more information.
[[https://pypi.org/project/sphinxcontrib-cheeseshop/|sphinxcontrib-cheeseshop]] [[http://sphinx-doc.org/|Sphinx]] extension that adds link to latest package version to docs by including HTML code that uses JSON API above. Last released 2010.

PyPI APIs: Simple, JSON, XMLRPC.

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

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

  • https://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

  • https://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="https://pypi.python.org/pypi/roundup">latest</a></span>
<script type="text/javascript">
 $.getJSON('https://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. Last released 2010.

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

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