Debian Codegraph @

docs/source/intro.rst

raw
1 Introduction
2 ============
3
4 Prerequisites
5 -------------
6
7 Yarg works with Python 2.6.x, 2.7.x, => 3.3, pypy and pypy3.
8
9 Installation
10 ------------
11
12 There are multiple ways to install Yarg.
13
14 As source or as a wheel from PyPI using easy_install or pip:
15
16 .. code-block:: bash
17
18 easy_install yarg
19 pip install yarg
20
21 From the tarball release
22 ------------------------
23
24 1. Download the most recent tarball from the `PyPI download
25 page <https://pypi.python.org/pypi/yarg>`_
26 2. Unpack the tarball
27 3. python setup.py install
28
29
30 Getting started
31 ---------------
32
33 Search interface
34 ~~~~~~~~~~~~~~~~
35
36 .. code-block:: python
37
38 >>> import yarg
39 >>> package = yarg.get("yarg")
40 >>> package.name
41 'yarg'
42 >>> package.author
43 Author(name='Kura', email='[email protected]')
44
45 :meth:`yarg.get` returns an instance of :class:`yarg.package.Package`.
46
47 Newest packages interface
48 ~~~~~~~~~~~~~~~~~~~~~~~~~
49
50 .. code-block:: python
51
52 >>> import yarg
53 >>> packages = yarg.newest_packages()
54 >>> packages
55 [<Package yarg>, <Package gray>, <Package ragy>]
56 >>> packages[0].name
57 'yarg'
58 >>> packages.url
59 'http://pypi.python.org/pypi/yarg
60
61 :meth:`yarg.newest_packages` returns a list of :class:`yarg.parse.Package`
62 objects.
63
64 Updated packages interface
65 ~~~~~~~~~~~~~~~~~~~~~~~~~~
66
67 .. code-block:: python
68
69 >>> import yarg
70 >>> packages = yarg.latest_updated_packages()
71 >>> packages
72 [<Package yarg>, <Package gray>, <Package ragy>]
73 >>> packages[0].name
74 'yarg'
75 >>> packages[0].version
76 '0.1.2'
77 >>> packages[0].url
78 'http://pypi.python.org/pypi/yarg/0.1.2
79
80 :meth:`yarg.latest_updated_packages` returns a list of :class:`yarg.parse.Package`
81 objects.