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