Skip to content

perspective.py v0.3.4

Latest
Compare
Choose a tag to compare
@Yilmaz4 Yilmaz4 released this 23 Jan 12:30
· 21 commits to main since this release

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 the perspective.utils class which can be used to sort the keys of the dictionary that the analyze function returned according to their values or in alphabetical in both ascending and descending order.
  • Added UnknownSorting exception type to the perspective.errors class, however, unlike its name suggests, this exception exists frankly to raise when an unknown string is provided to order or sort_by arguments of sort_response function.
  • Added export_json function to the perspective.utils class which can be used to export the dictionary that the analyze 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 the skip_on_lang keyword argument of analyze 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.