blob: 93b61c9336824e443ee8136cfe12485c601f4761 [file] [log] [blame]
Éric Araujo3a9f58f2011-06-01 20:42:49 +02001:mod:`packaging.pypi` --- Interface to projects indexes
2=======================================================
3
4.. module:: packaging.pypi
5 :synopsis: Low-level and high-level APIs to query projects indexes.
6
7
8Packaging queries PyPI to get information about projects or download them. The
9low-level facilities used internally are also part of the public API designed to
10be used by other tools.
11
12The :mod:`packaging.pypi` package provides those facilities, which can be
13used to access information about Python projects registered at indexes, the
14main one being PyPI, located ad http://pypi.python.org/.
15
16There is two ways to retrieve data from these indexes: a screen-scraping
17interface called the "simple API", and XML-RPC. The first one uses HTML pages
18located under http://pypi.python.org/simple/, the second one makes XML-RPC
19requests to http://pypi.python.org/pypi/. All functions and classes also work
20with other indexes such as mirrors, which typically implement only the simple
21interface.
22
23Packaging provides a class that wraps both APIs to provide full query and
24download functionality: :class:`packaging.pypi.client.ClientWrapper`. If you
25want more control, you can use the underlying classes
26:class:`packaging.pypi.simple.Crawler` and :class:`packaging.pypi.xmlrpc.Client`
27to connect to one specific interface.
28
29
30:mod:`packaging.pypi.client` --- High-level query API
31=====================================================
32
33.. module:: packaging.pypi.client
34 :synopsis: Wrapper around :mod;`packaging.pypi.xmlrpc` and
35 :mod:`packaging.pypi.simple` to query indexes.
36
37
38This module provides a high-level API to query indexes and search
39for releases and distributions. The aim of this module is to choose the best
40way to query the API automatically, either using XML-RPC or the simple index,
41with a preference toward the latter.
42
43.. class:: ClientWrapper
44
45 Instances of this class will use the simple interface or XML-RPC requests to
46 query indexes and return :class:`packaging.pypi.dist.ReleaseInfo` and
47 :class:`packaging.pypi.dist.ReleasesList` objects.
48
49 .. method:: find_projects
50
51 .. method:: get_release
52
53 .. method:: get_releases