From 385b1033061e19c51aef987f982d42c51ea4963e Mon Sep 17 00:00:00 2001 From: Sebastian Vetter Date: Sat, 8 Jun 2013 18:08:38 +1000 Subject: [PATCH] Add badges to readme --- README.rst | 58 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 24 deletions(-) diff --git a/README.rst b/README.rst index 91964bf..be34fc0 100644 --- a/README.rst +++ b/README.rst @@ -1,41 +1,51 @@ The ColourLovers Python API =========================== +.. image:: https://travis-ci.org/elbaschid/python-colourlovers.png?branch=master + :target: https://travis-ci.org/elbaschid/python-colourlovers + +.. image:: https://pypip.in/v/python-colourlovers/badge.png + :target: https://crate.io/packages/python-colourlovers/ + +.. image:: https://pypip.in/d/python-colourlovers/badge.png + :target: https://crate.io/packages/python-colourlovers/ + + This Python package ``python-colourlovers`` access to the ColourLovers.com API, a web service that allows users to publish colour themes and rate them. -The API of this webservice allows to search for users (Lovers) and their -posted contents (Colours, Patterns, Palettes). +The API of this webservice allows to search for users (Lovers) and their +posted contents (Colours, Patterns, Palettes). Accessing the API requires an instance of ``ColourLovers`` -which provides the methods to access the different content types: -*Colour*, *Palette*, *Pattern*, *Lover*. Sending a request to +which provides the methods to access the different content types: +*Colour*, *Palette*, *Pattern*, *Lover*. Sending a request to ColourLovers is as easy as calling the corresponding method such as -``ColourLovers.palettes()`` to search for palettes. -Additionally, the following arguments can be specified ``new``, ``top``, -``random`` with additional parameters. Please refer to the ColourLovers -API documentation to find out more about the specific parameters and +``ColourLovers.palettes()`` to search for palettes. +Additionally, the following arguments can be specified ``new``, ``top``, +``random`` with additional parameters. Please refer to the ColourLovers +API documentation to find out more about the specific parameters and their restrictions at http://www.colourlovers.com/api. You find the ColourLovers website at: http://www.colourlovers.com The ColourLovers.com API is provided under the Creative Commons -**Attribution-Noncommercial-Share Alike** license. Please refer to +**Attribution-Noncommercial-Share Alike** license. Please refer to http://www.colourlovers.com/api for more information on the license and Terms Of Use. -You find the source code and the latest development version on github: +You find the source code and the latest development version on github: https://github.com/elbaschid/python-colourlovers. That's also the place where you can leave feedback and contribute your own code. Just fork the -repo, make your changes and send me a pull request :) +repo, make your changes and send me a pull request :) Colours ------- The ColourLovers.com API provides two different ways to retrieve a -colour or a list of colours. +colour or a list of colours. -1. Searching for a single colour by calling the ``ColourLovers.color()`` +1. Searching for a single colour by calling the ``ColourLovers.color()`` method with the desired colour's hexcode, e.g. ``#37cbff``. This will return the corresponding colour as ``ColourLovers.Colour`` instance. 2. Searching for multiple colours by calling ``ColourLovers.colours()`` @@ -54,15 +64,15 @@ Example:: >>> cl.palettes('new', keywords='funky', numResults=3) [, , - ] + ] Palettes -------- The ColourLovers.com API provides two different ways to retrieve a -palette or a list of palettes: +palette or a list of palettes: -1. Searching for a single palette by calling the ``ColourLovers.palette()`` +1. Searching for a single palette by calling the ``ColourLovers.palette()`` method with the desired palette ID, e.g. ``1942043``. This will return the corresponding colour as ``ColourLovers.Palette`` instance. 2. Searching for multiple palettes by calling ``ColourLovers.palettes()`` @@ -85,9 +95,9 @@ Patterns -------- The ColourLovers.com API provides two different ways to retrieve a -pattern or a list of patterns. +pattern or a list of patterns. -1. Searching for a single pattern by calling the ``ColourLovers.pattern()`` +1. Searching for a single pattern by calling the ``ColourLovers.pattern()`` method with the desired pattern's ID, e.g. ``2111513``. This will return the corresponding pattern as ``ColourLovers.Pattern`` instance. 2. Searching for multiple patterns by calling ``ColourLovers.patterns()`` @@ -111,14 +121,14 @@ Lovers ------ The ColourLovers.com API provides two different ways to retrieve a -'lover' or a list of 'lovers'. +'lover' or a list of 'lovers'. -1. Searching for a single lover by calling the ``ColourLovers.lover()`` +1. Searching for a single lover by calling the ``ColourLovers.lover()`` method with the desired lover's user name, e.g. ``Alkalaiblue``. This will return the corresponding lover as ``ColourLovers.Lover`` instance. 2. Searching for multiple lovers by calling ``ColourLovers.lovers()`` - with one of these arguments: ``new`` and ``top`` (``random`` is not - available in this case). This will return a list of + with one of these arguments: ``new`` and ``top`` (``random`` is not + available in this case). This will return a list of ``ColourLovers.Lover`` objects. For details on additional parameters please refer to the documentation at @@ -140,10 +150,10 @@ Example:: Stats ----- -To retrieve some basic statistics for certain content types provided on +To retrieve some basic statistics for certain content types provided on ColourLovers.com you can call ``ColourLovers.stats`` with one of the following *stat_types*: ``colours``, ``palettes``, ``patterns``, ``lovers``. Each call -returns a ``ColourLovers.Stats`` instance holding the total number of the +returns a ``ColourLovers.Stats`` instance holding the total number of the requested content type on ColourLovers.com. Example::