Code Monkey home page Code Monkey logo

colourlovers-api-wrapper's People

Contributors

flopp avatar juangallostra avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

colourlovers-api-wrapper's Issues

patterns request=random throws keyword error

cl = clapi.ColourLovers()
pattern = cl.search_patterns(request='random')[0]

Current behavior

KeyError: 'request'

Expected behavior

'new' and 'top' return correct result

Screenshot (optional)

Document container objects extra methods

Current behavior

The README does not list the extra methods (such as draw) available in some of the container objects obtained after a request.

Expected behavior

This methods are listed and demonstrated in the README.

Random search for palettes doesn't work

Steps to reproduce

Setup:

python3 -m venv .env
.env/bin/pip install --upgrade pip
.env/bin/pip install colourlovers

Then run .env/bin/python script.py with

from colourlovers import clapi
cl = clapi.ColourLovers()

for type in ['new', 'top', 'random']:
    print(type)
    print(cl.search_palettes(request=type, numResults=1))

Current behavior

This prints

new
[<colourlovers.data_containers.Palette object at 0x7f33644cad60>]
top
[<colourlovers.data_containers.Palette object at 0x7f3362fcec10>]
random
Traceback (most recent call last):
  File "./script.py", line 8, in <module>
    print(cl.search_palettes(request=type, numResults=1))
  File "./.env/lib/python3.8/site-packages/colourlovers/clapi.py", line 237, in _api_search
    processed_request = self.__process_optional_requests(search_type, **kwargs)
  File "./.env/lib/python3.8/site-packages/colourlovers/clapi.py", line 402, in __process_optional_requests
    del kwargs[valid_keyword]
KeyError: 'request'

So, new and top searches work, but random fails.

Expected behavior

cl.search_palettes(request="random", numResults=1) should return a list containing one random Palette object.

Rename modules so that imports are easier

Current behavior

It is hard to import the API wrapper. Currently, to import the wrapper one has to:

from colourlovers_api import wrapper
cl = wrapper.ColourLovers()

Expected behavior

The API wrapper can be easily imported and with names that make sense.

Screenshot (optional)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.