Package: hspylib-hqt
HomeSetup Python Library - HsPyLibYour Python code is not JUST a script !!HsPyLib is a Python library that will elevate your experience to another level. It relies on well known principles as
SOLID, DRY (Don't Repeat Yourself), KISS (Keep It Simple, Stupid) and YAGNI (You Ain’t Gonna Need It). It provides many
frameworks and facilities to help you create mature python3 applications "PYCSNBASS" (Python Code Should Not Be A Simple
Script).HsPyLib is a part of theHomeSetupproject.HighlightsEasy installation.Application manager that provides a helper to scaffold your python applications.Widgets manager that provides running 'built-in' and custom python widgets.Enhanced TUI helpers and input methods, to elevate your UXP with terminal applications.crud framework to help with databases, repositories and services.HTTP request helpers.Enable Properties and AppConfigs using the most common extensions such as .properties, toml, yml...Well tested code and often pylint clean.Gradle build system with many extensions.Various demos to help understand the library.A Kafka managerapplication tool.A Cloud Foundryapplication tool.A Firebaseapplication tool.A Vault providertool.A CLI Terminalframework.A PyQtapplications framework.Create an easy to use and code multiple select or choose input method:fromhspylib.modules.cli.vt100.vt_colorimportVtColorfromclitt.core.icons.font_awesome.nav_iconsimportNavIconsfromclitt.core.tui.mselect.mselectimportmselectfromclitt.core.tui.tui_preferencesimportTUIPreferencesclassSelectableItem:def__init__(self,name:str,value:str):self.name=nameself.value=valuedef__str__(self):returnf"Name:{self.name}Value:{self.value}"def__repr__(self):returnstr(self)if__name__=="__main__":TUIPreferences(max_rows=10,highlight_color=VtColor.WHITE,selected=NavIcons.SELECTED,unselected=NavIcons.UNSELECTED,)quantity=22digits=len(str(quantity))it=[SelectableItem(f"Item-{n:>0{digits}}",f"Value-{n:>0{digits}}")forninrange(1,quantity)]sel=mselect(it)print(str(sel))fromhspylib.modules.cli.vt100.vt_colorimportVtColorfromclitt.core.tui.mchoose.mchooseimportmchoosefromclitt.core.tui.tui_preferencesimportTUIPreferencesclassChooseableItem:def__init__(self,name:str,value:str):self.name=nameself.value=valuedef__str__(self):returnf"Name:{self.name}Value:{self.value}"def__repr__(self):returnstr(self)if__name__=="__main__":TUIPreferences(max_rows=10,highlight_color=VtColor.WHITE)quantity=22digits=len(str(quantity))it=[ChooseableItem(f"Item-{n:>0{digits}}",f"Value-{n:>0{digits}}")forninrange(1,quantity)]sel=mchoose(it)print(str(sel))Create beautiful form inputs:fromclitt.core.tui.minput.input_validatorimportInputValidatorfromclitt.core.tui.minput.minputimportMenuInput,minputif__name__=="__main__":# fmt: offform_fields=MenuInput.builder()\.field()\.label('letters')\.validator(InputValidator.letters())\.build()\.field()\.label('word')\.validator(InputValidator.words())\.build()\.field()\.label('number')\.validator(InputValidator.numbers())\.min_max_length(1,4)\.build()\.field()\.label('masked')\.itype('masked')\.value('|##::##::## @@')\.build()\.field()\.label('selectable')\.itype('select')\.value('one|two|three')\.build()\.field()\.label('checkbox')\.itype('checkbox')\.build()\.field()\.label('password')\.itype('password')\.validator(InputValidator.anything())\.min_max_length(4,8)\.build()\.field()\.label('read-only')\.access_type('read-only')\.value('READ-ONLY')\.build()\.build()# fmt: onresult=minput(form_fields)print(result.__dict__ifresultelse"None")Or even create nice dashboards:fromhspylib.modules.cli.vt100.vt_colorimportVtColorfromclitt.core.icons.font_awesome.dashboard_iconsimportDashboardIconsfromclitt.core.tui.mdashboard.mdashboardimportmdashboard,MenuDashBoardfromclitt.core.tui.tui_preferencesimportTUIPreferencesif__name__=="__main__":TUIPreferences(max_rows=10,items_per_line=3,highlight_color=VtColor.WHITE)# fmt: offdashboard_items=MenuDashBoard.builder()\.item()\.icon(DashboardIcons.POWER)\.tooltip('Do something')\.on_trigger(lambda:print('Something'))\.build()\.item()\.icon(DashboardIcons.MOVIE)\.tooltip('Another something')\.on_trigger(lambda:print('Another'))\.build()\.item()\.icon(DashboardIcons.NOTIFICATION)\.tooltip('Notify something')\.on_trigger(lambda:print('Notification'))\.build()\.item()\.icon(DashboardIcons.LIST)\.tooltip('List everything')\.on_trigger(lambda:print('List'))\.build()\.item()\.icon(DashboardIcons.DATABASE)\.tooltip('Database console')\.on_trigger(lambda:print('Database'))\.build()\.item()\.icon(DashboardIcons.EXIT)\.tooltip('Exit application')\.on_trigger(lambda:print('Exit'))\.build()\.build()# fmt: onresult=mdashboard(dashboard_items)Table of contents1. Installation1.1. Requirements1.1.1. Operating systems1.1.2. Required software1.2. PyPi1.3. GitHub2. Documentation3. Contact4. Support HsPyLib5. LinksInstallationRequirementsPythonPython 3.10 and higherOperating SystemsDarwinHigh Sierra and higherLinuxUbuntu 16 and higherCentOS 7 and higherFedora 31 and higherYou may want to install HsPyLib on other OS's and it will probably work, but there are no guarantees that itWILL ACTUALLY WORK.Required softwareThe following software are required:Git (To clone the github repository)Gradle (To build the HsPyLib project)There are some python dependencies, but they will be automatically downloaded when the build runs.PyPiTo install HsPyLib from PyPi issue the command:# python3 -m pip install hspylibTo upgrade HsPyLib use the command:# python3 -m pip install hspylib --upgradeAdditional modules that can also be installed:CLItt:# python3 -m pip install hspylib-clittto install HsPyLib CLI terminal tools.Firebase:# python3 -m pip install hspylib-firebaseto install HsPyLib Firebase application.Vault:# python3 -m pip install hspylib-vaultto install HsPyLib Vault application.CFMan:# python3 -m pip install hspylib-cfmanto install CloudFoundry manager.Kafman:# python3 -m pip install hspylib-kafmanto install Kafka manager.Datasource:# python3 -m pip install hspylib-datasourceto install datasource helpers.HQT:# python3 -m pip install hspylib-hqtto install HsPyLib PyQt framework.GitHubTo clone HsPyLib into your local machine type the command:# git clone https://github.com/yorevs/hspylib.gitDocumentationThe API documentation can be foundhereContactYou can contact us using ourGittercommunity or using ourReddit.Support HsPyLibYou can support HsPyLib
bydonatingor coding. Fell free to contact me for details. When contributing with code change please take a look at ourguidelinesandcode of conduct.SponsorsThis project is supported by:Thank you for your support <3 !!LinksDocumentation:APILicense:MITReleases:HSPyLib-ReleasesCode:GithubIssue tracker:HSPyLib-IssuesOfficial chat:HSPyLibContact:yorevsMailto:yorevs