Package: gooey-quick
gooey-quickTurn type-hinted Python program into a GUI application with few additional lines of codeTable of contentsgooey-quickTable of contentsQuick StartInstallationUsageGooey global configurationWhat is it?Why is it?ExamplesPackagingQuick StartInstallationYou can install gooey-quick via pip:pipinstallgooey-quickor by cloning the repository directly:gitclonehttps://github.com/jacadzaca/gooey_quick.git&&./setup.pyUsageYou can integrate gooey-quick with your code as easily as so:importgooey_quickdefsome_function_you_want_to_gooeyfiy(name:str,repeat_count:int,):for_inrange(repeat_count):print(f'Hello{name}')if__name__=='__main__':gooey_quick.run_gooey(some_function_you_want_to_gooeyfiy)Gooey global configurationYou can setGooey's global optionsby setting them in the call togooey_quick.run_gooeylike so:importgooey_quickdefsome_function_you_want_to_gooeyfiy(name:str,repeat_count:int,):for_inrange(repeat_count):print(f'Hello{name}')if__name__=='__main__':gooey_quick.run_gooey(some_function_you_want_to_gooeyfiy,program_name='Simple demo program',program_description='A demo program using Gooey and gooey_quick',)What is it?gooey-quick is a library that generates aGooey-basedGUIs from methods' signatures.Why is it?A lot of GUI programs that are written in an office setting are wrappers around
simple python code. Handcrafting GUIs can be cumbersome, while dealing with
argparse-like interface becomes more annoying as the program grows (e.g. you
have 6 tabs in your Advanced layout Gooey program). With gooey-quick you should
forget about the above and focus on the programs' features.How does it work?gooey-quick uses python's built-intypingandintrospectionfunctionalities
to analyze objects' signatures and generate a fancy GUI using the amazingGooeybychriskiehl.ExamplesSimple 'Flat layout' application#!/usr/bin/env python3fromenumimportEnumfrompathlibimportPathfromdatetimeimportdate,timeimportgooey_quickclassUploadMethod(Enum):SFTP='SFTP'HTTP='HTTP'defupload_file(file:Path,new_filename:str,chunksize:int,lattency:float,upload_date:date,upload_time:time,upload_method:UploadMethod,):asserttype(upload_method)isUploadMethodreturn(f'{file}was uploaded via{upload_method.name}on{upload_date}at 'f'{upload_time}in chunks of size{chunksize}and with lattency of 'f'{lattency}')if__name__=='__main__':# gooey_quick.run_gooey has the same return values as the wrapped functionreturn_value=gooey_quick.run_gooey(# the first argument is the fucntion you'd like to be converted into a Gooey programupload_file,# gooey_quick.run_gooey can be used to set Gooey's global configuration# see https://github.com/chriskiehl/Gooey#global-configuration for possible optionsprogram_name='Simple upload program',program_description='A demo program using Gooey and gooey_quick',)print(return_value)Start Gooey in Advanced mode with 3 different tabs:#!/usr/bin/env python3frompathlibimportPathfromtypingimportOptionalfromdatetimeimportdate,datetimeimportgooey_quickdefsearch_history(history_file:Path,wanted_phrase:str,min_occure_date:Optional[date]=None,max_occure_date:Optional[date]=None,)->Optional[tuple[date,str]]:occurance_date=date(year=2002,month=7,day=22)the_phrase="wow you have discovered my secret phrase!"occurance_in_range=Trueifmin_occure_dateisnotNoneandmax_occure_dateisnotNone:print(f'Looking for{wanted_phrase}from{min_occure_date}to{max_occure_date}...')occurance_in_range=occurance_dateinrange(min_occure_date,max_occure_date)ifwanted_phraseinthe_phraseandoccurance_in_range:returnf'{occurance_date}:{the_phrase}'defappend_to_history(history_file:Path,phrase:str,occurance_date:date=datetime.now().date()):returnf'Appending{phrase}to{history_file}at{occurance_date}...'defremove_from_history(history_file:Path,phrase:str,):returnf'Removing{phrase}from{history_file}...'if__name__=='__main__':# when passing a dict to gooey_quick.run_gooey, the keys become# the tabs descriptions, while the values are the function to# create the gui fromreturn_value=gooey_quick.run_gooey({'Add phrase':append_to_history,'Remove phrase':remove_from_history,'Search phrases':search_history,},# set Gooey's global config as per: https://github.com/chriskiehl/Gooey#layout-customizationnavigation='TABBED',program_name='Gooey subparser layout from function dict',program_description='Presents how to create a bundeled configuration with gooey_quick',)print(return_value)For more see thedocs/examples/directory.PackagingPlease refer to either theofficial guideorthis tutorial