alexis-mignon / python-flickr-api

A python implementation of the Flickr API
BSD 3-Clause "New" or "Revised" License
367 stars 108 forks source link

New Sample Project: Python Flickr API Shell #58

Closed eloyz closed 9 years ago

eloyz commented 9 years ago

Running python shell <access_token_file.txt> will auto-authenticate, create a user object and place you in a shell so that you're ready to real-time interact with the API. Making it easier to explore the API and have some fun.

Example input/output below.

$ python shell.py access_token.txt 
Python 2.7.8 (default, Oct 27 2014, 15:08:00) 
Type "copyright", "credits" or "license" for more information.

IPython 3.0.0 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: type(user)
Out[1]: flickr_api.objects.Person
alexis-mignon commented 9 years ago

Hello,

Thanks for this new script. In order to be added to the code I would like a few modifications to be added. I don't want to add external dependencies if it is not totally required. So I am not ready to add ipython or pillow (for your other pull request) as a dependency while most of the project does not require it.

Instead, I would prefer having the import on those external libraries surrounded by a try/catch and an error message displayed in case the required module is not installed.

For this script printing the message (using warnings module ?) and raising SytemExit should be enough. I'll comment further on this in the thread regarding the problem with PIL.

Thanks again for the contribution.

Alexis

eloyz commented 9 years ago

Updated

alexis-mignon commented 9 years ago

Thanks for the addition