Here is a release which includes yet some other ideas I've added and some bugs that I've noticed while implementing my ideas and I've fixed. You can see my ideas below.
New features
- Added yet another example code, but this time it introduces an easy-to-use GUI (Graphical User Interface) written with tkinter library. However, understanding the code requires some object-oriented programming knowledge and experience. Despite the source code is available in the repository, I actually designed the GUI for end-users therefore it's more like a demo for the API.
- Added
sort_response
function to theperspective.utils
class which can be used to sort the keys of the dictionary that theanalyze
function returned according to their values or in alphabetical in both ascending and descending order. - Added
UnknownSorting
exception type to theperspective.errors
class, however, unlike its name suggests, this exception exists frankly to raise when an unknown string is provided toorder
orsort_by
arguments ofsort_response
function. - Added
export_json
function to theperspective.utils
class which can be used to export the dictionary that theanalyze
function returned to a file in JSON format as the name of the function suggests. The file name can be anything.
Bug fixes
- Fixed
EmptyResponse
exception when none of the requested attributes supported the language of the text provided and when theskip_on_lang
keyword argument ofanalyze
function was set to True therefore the response was (supposed to be) an empty dictionary. The exception was caused by the logging line of the function.