Package: python-colourlovers
This Python packagepython-colourloversaccess 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).Accessing the API requires an instance ofColourLoverswhich 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 asColourLovers.palettes()to search for palettes.
Additionally, the following arguments can be specifiednew,top,randomwith additional parameters. Please refer to the ColourLovers
API documentation to find out more about the specific parameters and
their restrictions athttp://www.colourlovers.com/api.You find the ColourLovers website at:http://www.colourlovers.comThe ColourLovers.com API is provided under the Creative CommonsAttribution-Noncommercial-Share Alikelicense. Please refer tohttp://www.colourlovers.com/apifor more information on the license
and Terms Of Use.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 :)ColoursThe ColourLovers.com API provides two different ways to retrieve a
colour or a list of colours.Searching for a single colour by calling theColourLovers.color()method with the desired colour’s hexcode, e.g.#37cbff. This will
return the corresponding colour asColourLovers.Colourinstance.Searching  for multiple colours by callingColourLovers.colours()with one of these arguments:new,top,random. This will
return a list ofColourLovers.Colourobjects.For details on additional parameters please refer to the documentation athttp://python-colourlovers.readthedocs.orgExample:>>> from colourlovers import ColourLovers
>>> cl = ColourLovers()
>>> cl.color('#37cbff')
[<Colour id='4767129' title='i feel pretty' rgb=(55, 203, 255)>]
>>> cl.palettes('new', keywords='funky', numResults=3)
[<Palette id='1940972' title='"Funky President"'>,
 <Palette id='1936394' title='Barbie Doll Blonde'>,
 <Palette id='1936247' title='Lily's Rainbow'>]PalettesThe ColourLovers.com API provides two different ways to retrieve a
palette or a list of palettes:Searching for a single palette by calling theColourLovers.palette()method with the desired palette ID, e.g.1942043. This will
return the corresponding colour asColourLovers.Paletteinstance.Searching  for multiple palettes by callingColourLovers.palettes()with one of these arguments:new,top,random. This will
return a list ofColourLovers.Paletteobjects.For details on additional parameters please refer to the documentation athttp://python-colourlovers.readthedocs.orgExample:>>> from colourlovers import ColourLovers
>>> cl = ColourLovers()
>>> cl.palettes('random')
[<Palette id='114699' title='chunky butt'>]
>>> cl.palette(1942043)
[<Palette id='1942043' title='Drinking Game 2'>]PatternsThe ColourLovers.com API provides two different ways to retrieve a
pattern or a list of patterns.Searching for a single pattern by calling theColourLovers.pattern()method with the desired pattern’s ID, e.g.2111513. This will
return the corresponding pattern asColourLovers.Patterninstance.Searching  for multiple patterns by callingColourLovers.patterns()with one of these arguments:new,top,random. This will
return a list ofColourLovers.Patternobjects.For details on additional parameters please refer to the documentation athttp://python-colourlovers.readthedocs.orgExample:>>> from colourlovers import ColourLovers
>>> cl = ColourLovers()
>>> cl.patterns('random')
[<Pattern id='391644' title='acanalado'>]
>>> cl.pattern(2111513)
[<Pattern id='2111513' title='Converse on Nothing'>]LoversThe ColourLovers.com API provides two different ways to retrieve a
‘lover’ or a list of ‘lovers’.Searching for a single lover by calling theColourLovers.lover()method with the desired lover’s user name, e.g.Alkalaiblue. This will
return the corresponding lover asColourLovers.Loverinstance.Searching  for multiple lovers by callingColourLovers.lovers()with one of these arguments:newandtop(randomis not
available in this case). This will return a list ofColourLovers.Loverobjects.For details on additional parameters please refer to the documentation athttp://python-colourlovers.readthedocs.orgExample:>>> from colourlovers import ColourLovers
>>> cl = ColourLovers()
>>> cl.lovers('new', numResults=4)
[<Lover username='alliesuesue'>,
 <Lover username='NAJ910'>,
 <Lover username='VooDooDoll23'>,
 <Lover username='kidknie'>]
>>> cl.lover('Alkalaiblue')
[<Lover username='Alkalaiblue'>]StatsTo retrieve some basic statistics for certain content types provided on
ColourLovers.com you can callColourLovers.statswith one of the followingstat_types:colours,palettes,patterns,lovers. Each call
returns aColourLovers.Statsinstance holding the total number of the
requested content type on ColourLovers.com.Example:>>> from colourlovers import ColourLovers
>>> cl = ColourLovers()
>>> cl.stats('lovers')
<Stat total='1113083'>
>>> cl.stats('patterns')
<Stat total='2096087'>Changelog0.1.0Improve test coverage and clean up of test code.Switch fromurllib2torequestslibrary for HTTP requests.0.0.1Initial release