hspylib-clitt 0.9.102__tar.gz → 0.9.147__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. hspylib_clitt-0.9.147/MANIFEST.in +3 -0
  2. hspylib_clitt-0.9.147/PKG-INFO +365 -0
  3. hspylib_clitt-0.9.147/README.md +319 -0
  4. hspylib_clitt-0.9.147/clitt/.version +1 -0
  5. hspylib_clitt-0.9.147/clitt/__classpath__.py +28 -0
  6. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/__init__.py +2 -2
  7. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/__main__.py +9 -9
  8. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/addons/__init__.py +2 -2
  9. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/addons/appman/__init__.py +2 -2
  10. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/addons/appman/appman.py +15 -13
  11. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/addons/appman/appman_enums.py +2 -2
  12. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/addons/appman/templates/__init__.py +2 -2
  13. hspylib_clitt-0.9.147/clitt/addons/appman/templates/__pycache__/__init__.cpython-311.pyc +0 -0
  14. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/addons/appman/templates/build.gradle.tpl +7 -7
  15. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/addons/appman/templates/main.py.tpl +2 -2
  16. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/addons/appman/templates/main_qt.py.tpl +2 -2
  17. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/addons/appman/templates/main_qt_view.py.tpl +2 -2
  18. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/addons/appman/templates/test_main.py.tpl +1 -1
  19. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/addons/appman/templates/widget.py.tpl +1 -1
  20. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/addons/widman/__init__.py +2 -2
  21. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/addons/widman/widget.py +2 -2
  22. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/addons/widman/widget_entry.py +3 -3
  23. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/addons/widman/widgets/__init__.py +2 -2
  24. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/addons/widman/widgets/widget_free.py +22 -12
  25. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/addons/widman/widgets/widget_punch.py +2 -2
  26. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/addons/widman/widgets/widget_send_msg.py +2 -2
  27. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/addons/widman/widgets/widget_time_calc.py +2 -2
  28. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/addons/widman/widman.py +6 -6
  29. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/__init__.py +2 -2
  30. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/exception/__init__.py +2 -2
  31. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/exception/exceptions.py +3 -2
  32. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/icons/__init__.py +2 -2
  33. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/icons/emojis/__init__.py +2 -2
  34. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/icons/emojis/emojis.py +2 -2
  35. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/icons/emojis/face_smiling.py +2 -2
  36. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/icons/font_awesome/__init__.py +2 -2
  37. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/icons/font_awesome/app_icons.py +3 -2
  38. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/icons/font_awesome/awesome.py +2 -2
  39. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/icons/font_awesome/dashboard_icons.py +2 -2
  40. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/icons/font_awesome/form_icons.py +2 -2
  41. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/icons/font_awesome/game_icons.py +13 -2
  42. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/icons/font_awesome/nav_icons.py +2 -2
  43. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/icons/font_awesome/trickplay_icons.py +2 -2
  44. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/icons/font_awesome/widget_icons.py +2 -2
  45. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/preferences.py +2 -2
  46. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/term/__init__.py +2 -2
  47. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/term/commons.py +41 -17
  48. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/term/cursor.py +63 -20
  49. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/term/screen.py +18 -0
  50. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/term/terminal.py +77 -39
  51. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/__init__.py +3 -2
  52. hspylib_clitt-0.9.147/clitt/core/tui/line_input/__init__.py +12 -0
  53. hspylib_clitt-0.9.147/clitt/core/tui/line_input/keyboard_input.py +389 -0
  54. hspylib_clitt-0.9.147/clitt/core/tui/line_input/line_input.py +41 -0
  55. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/mchoose/__init__.py +2 -2
  56. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/mchoose/mchoose.py +6 -3
  57. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/mchoose/menu_choose.py +16 -17
  58. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/mdashboard/__init__.py +2 -2
  59. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/mdashboard/dashboard_builder.py +2 -2
  60. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/mdashboard/dashboard_item.py +2 -2
  61. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/mdashboard/mdashboard.py +2 -2
  62. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/mdashboard/menu_dashboard.py +8 -6
  63. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/menu/__init__.py +2 -2
  64. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/menu/tui_menu.py +2 -2
  65. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/menu/tui_menu_action.py +2 -2
  66. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/menu/tui_menu_factory.py +2 -2
  67. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/menu/tui_menu_item.py +2 -2
  68. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/menu/tui_menu_ui.py +9 -2
  69. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/menu/tui_menu_view.py +2 -2
  70. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/minput/__init__.py +2 -2
  71. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/minput/access_type.py +2 -2
  72. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/minput/field_builder.py +4 -4
  73. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/minput/form_builder.py +2 -2
  74. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/minput/form_field.py +2 -2
  75. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/minput/input_type.py +2 -2
  76. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/minput/input_validator.py +3 -3
  77. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/minput/menu_input.py +19 -23
  78. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/minput/minput.py +2 -2
  79. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/minput/minput_utils.py +2 -2
  80. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/mselect/__init__.py +2 -2
  81. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/mselect/menu_select.py +5 -10
  82. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/mselect/mselect.py +2 -2
  83. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/table/__init__.py +2 -2
  84. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/table/table_enums.py +2 -2
  85. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/table/table_renderer.py +10 -3
  86. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/tui_application.py +12 -25
  87. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/tui_component.py +35 -22
  88. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/core/tui/tui_preferences.py +3 -3
  89. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/utils/__init__.py +2 -2
  90. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/utils/git_utils.py +17 -15
  91. hspylib_clitt-0.9.147/hspylib_clitt.egg-info/PKG-INFO +365 -0
  92. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/hspylib_clitt.egg-info/SOURCES.txt +4 -0
  93. hspylib_clitt-0.9.147/hspylib_clitt.egg-info/requires.txt +5 -0
  94. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/setup.py +2 -2
  95. hspylib-clitt-0.9.102/MANIFEST.in +0 -3
  96. hspylib-clitt-0.9.102/PKG-INFO +0 -42
  97. hspylib-clitt-0.9.102/README.md +0 -10
  98. hspylib-clitt-0.9.102/clitt/.version +0 -1
  99. hspylib-clitt-0.9.102/clitt/__classpath__.py +0 -28
  100. hspylib-clitt-0.9.102/hspylib_clitt.egg-info/PKG-INFO +0 -42
  101. hspylib-clitt-0.9.102/hspylib_clitt.egg-info/requires.txt +0 -4
  102. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/addons/appman/templates/classpath.py.tpl +0 -0
  103. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/addons/appman/templates/dependencies.hspd.tpl +0 -0
  104. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/addons/appman/templates/gitignore.tpl +0 -0
  105. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/addons/appman/templates/main_qt_view.ui.tpl +0 -0
  106. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/addons/appman/templates/run.sh.tpl +0 -0
  107. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/addons/appman/templates/usage.txt.tpl +0 -0
  108. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/clitt/welcome.txt +0 -0
  109. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/hspylib_clitt.egg-info/dependency_links.txt +0 -0
  110. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/hspylib_clitt.egg-info/top_level.txt +0 -0
  111. {hspylib-clitt-0.9.102 → hspylib_clitt-0.9.147}/setup.cfg +0 -0
@@ -0,0 +1,3 @@
1
+ include clitt/welcome.txt
2
+ include clitt/.version
3
+ recursive-include clitt/addons/appman/templates *
@@ -0,0 +1,365 @@
1
+ Metadata-Version: 2.4
2
+ Name: hspylib-clitt
3
+ Version: 0.9.147
4
+ Summary: HsPyLib - CLI Terminal Tools
5
+ Home-page: https://github.com/yorevs/hspylib
6
+ Author: Hugo Saporetti Junior
7
+ Author-email: yorevs@hotmail.com
8
+ License: MIT
9
+ Project-URL: GitHub, https://github.com/yorevs/hspylib
10
+ Project-URL: PyPi, https://pypi.org/project/hspylib-clitt/
11
+ Keywords: cli,clitt,terminal,tui,manager,application,widgets
12
+ Platform: Darwin
13
+ Platform: Linux
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Operating System :: MacOS :: MacOS X
17
+ Classifier: Operating System :: POSIX :: Linux
18
+ Classifier: Operating System :: Unix
19
+ Classifier: Development Status :: 3 - Alpha
20
+ Classifier: Environment :: Console
21
+ Classifier: Natural Language :: English
22
+ Classifier: Topic :: Terminals
23
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
+ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
25
+ Classifier: Intended Audience :: Developers
26
+ Requires-Python: >=3.10
27
+ Description-Content-Type: text/markdown
28
+ Requires-Dist: hspylib
29
+ Requires-Dist: pyperclip>=1.11.0
30
+ Requires-Dist: urllib3>=1.26.20
31
+ Requires-Dist: emoji>=2.12.1
32
+ Requires-Dist: rich>=14.2.0
33
+ Dynamic: author
34
+ Dynamic: author-email
35
+ Dynamic: classifier
36
+ Dynamic: description
37
+ Dynamic: description-content-type
38
+ Dynamic: home-page
39
+ Dynamic: keywords
40
+ Dynamic: license
41
+ Dynamic: platform
42
+ Dynamic: project-url
43
+ Dynamic: requires-dist
44
+ Dynamic: requires-python
45
+ Dynamic: summary
46
+
47
+ <img src="https://iili.io/HYBJFA7.png" width="64" height="64" align="right" />
48
+
49
+ # HomeSetup Python Library
50
+ >
51
+ > Because your Python code is not JUST a script !
52
+
53
+ [![PyPi](https://badgen.net/badge/icon/python?icon=pypi&label)](https://pypi.org/project/hspylib)
54
+ [![Gitter](https://badgen.net/badge/icon/gitter?icon=gitter&label)](https://gitter.im/hspylib/community)
55
+ [![Donate](https://badgen.net/badge/paypal/donate/yellow)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=J5CDEFLF6M3H4)
56
+ [![License](https://badgen.net/badge/license/MIT/gray)](LICENSE.md)
57
+ [![Release](https://badgen.net/badge/release/v0.9.147/gray)](docs/CHANGELOG.md#unreleased)
58
+ [![build-and-test](https://github.com/yorevs/hspylib/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/yorevs/hspylib/actions/workflows/build-and-test.yml)
59
+
60
+ HsPyLib is not just a Python library; it's a gateway to elevating your programming experience to new heights. Built on
61
+ established principles like **SOLID**, **DRY** (Don't Repeat Yourself), **KISS** (Keep It Simple, Stupid), and **YAGNI**
62
+ (You Ain’t Gonna Need It), HsPyLib offers a wealth of frameworks and features. It empowers you to craft sophisticated
63
+ Python3 applications, adhering to the philosophy that code should not merely be a simple script - it should be a part
64
+ of the 'PYCSNBASS' (Python Code Should Not Be A Simple Script) mindset.
65
+
66
+ > This project is a part of the [HomeSetup](https://github.com/yorevs/homesetup) project.
67
+
68
+ ## Key Features
69
+
70
+ - Seamless installation process.
71
+ - Application manager offering a helpful scaffold for Python applications.
72
+ - Widgets manager for running both 'built-in' and custom Python widgets.
73
+ - Improved TUI (Text User Interface) helpers and input methods to enhance your User Experience with terminal applications.
74
+ - CRUD (Create, Read, Update, Delete) framework aiding with databases, repositories, and services.
75
+ - HTTP request helpers for simplified communication.
76
+ - Support for enabling Properties and AppConfigs using popular extensions like .properties, toml, yml, and more.
77
+ - Code rigorously tested and consistently adhering to Pylint standards.
78
+ - Utilizes the Gradle build system with numerous extensions.
79
+ - Diverse set of demos to facilitate a deeper understanding of the library.
80
+ - AI model integrations (currently supporting OpenAI).
81
+
82
+ > Create beautiful menu-select inputs
83
+
84
+ ```python
85
+ class SelectableItem:
86
+ def __init__(self, name: str, value: str):
87
+ self.name = name
88
+ self.value = value
89
+
90
+ def __str__(self):
91
+ return f"Name: {self.name} Value: {self.value}"
92
+
93
+ def __repr__(self):
94
+ return str(self)
95
+
96
+
97
+ if __name__ == "__main__":
98
+ quantity = 22
99
+ digits = len(str(quantity))
100
+ it = [SelectableItem(f"Item-{n:>0{digits}}", f"Value-{n:>0{digits}}") for n in range(1, quantity)]
101
+ sel = mselect(it)
102
+ print(str(sel))
103
+ ```
104
+
105
+ ![MenuSelect](https://iili.io/HYBFh74.png "MenuSelect")
106
+
107
+ > And create beautiful menu-choose inputs
108
+
109
+ ```python
110
+ class ChooseableItem:
111
+ def __init__(self, name: str, value: str):
112
+ self.name = name
113
+ self.value = value
114
+
115
+ def __str__(self):
116
+ return f"Name: {self.name} Value: {self.value}"
117
+
118
+ def __repr__(self):
119
+ return str(self)
120
+
121
+
122
+ if __name__ == "__main__":
123
+ quantity = 22
124
+ digits = len(str(quantity))
125
+ it = [ChooseableItem(f"Item-{n:>0{digits}}", f"Value-{n:>0{digits}}") for n in range(1, quantity)]
126
+ sel = mchoose(it, [n % 2 == 0 for n in range(1, quantity)])
127
+ print(str(sel))
128
+ ```
129
+
130
+ ![MenuChoose](https://iili.io/HYBFwp2.png "MenuChoose")
131
+
132
+ > And also, create beautiful form inputs
133
+
134
+ ```python
135
+ from clitt.core.tui.minput.input_validator import InputValidator
136
+ from clitt.core.tui.minput.minput import MenuInput, minput
137
+
138
+ if __name__ == "__main__":
139
+ # fmt: off
140
+ form_fields = MenuInput.builder() \
141
+ .field() \
142
+ .label('letters') \
143
+ .validator(InputValidator.letters()) \
144
+ .build() \
145
+ .field() \
146
+ .label('word') \
147
+ .validator(InputValidator.words()) \
148
+ .build() \
149
+ .field() \
150
+ .label('number') \
151
+ .validator(InputValidator.numbers()) \
152
+ .min_max_length(1, 4) \
153
+ .build() \
154
+ .field() \
155
+ .label('masked') \
156
+ .itype('masked') \
157
+ .value('|##::##::## @@') \
158
+ .build() \
159
+ .field() \
160
+ .label('selectable') \
161
+ .itype('select') \
162
+ .value('one|two|three') \
163
+ .build() \
164
+ .field() \
165
+ .label('checkbox') \
166
+ .itype('checkbox') \
167
+ .build() \
168
+ .field() \
169
+ .label('password') \
170
+ .itype('password') \
171
+ .validator(InputValidator.anything()) \
172
+ .min_max_length(4, 8) \
173
+ .build() \
174
+ .field() \
175
+ .label('read-only') \
176
+ .access_type('read-only') \
177
+ .value('READ-ONLY') \
178
+ .build() \
179
+ .build()
180
+ # fmt: on
181
+
182
+ result = minput(form_fields)
183
+ print(result.__dict__ if result else "None")
184
+ ```
185
+
186
+ ![MenuInput](https://iili.io/HYBFVrG.png "MenuInput")
187
+
188
+ > Or even, create nice dashboards:
189
+
190
+ ```python
191
+ if __name__ == "__main__":
192
+ # fmt: off
193
+ dashboard_items = MenuDashBoard.builder() \
194
+ .item() \
195
+ .icon(DashboardIcons.POWER) \
196
+ .tooltip('Do something') \
197
+ .on_trigger(lambda: print('Something')) \
198
+ .build() \
199
+ .item() \
200
+ .icon(DashboardIcons.MOVIE) \
201
+ .tooltip('Another something') \
202
+ .on_trigger(lambda: print('Another')) \
203
+ .build() \
204
+ .item() \
205
+ .icon(DashboardIcons.NOTIFICATION) \
206
+ .tooltip('Notify something') \
207
+ .on_trigger(lambda: print('Notification')) \
208
+ .build() \
209
+ .item() \
210
+ .icon(DashboardIcons.LIST) \
211
+ .tooltip('List everything') \
212
+ .on_trigger(lambda: print('List')) \
213
+ .build() \
214
+ .item() \
215
+ .icon(DashboardIcons.DATABASE) \
216
+ .tooltip('Database console') \
217
+ .on_trigger(lambda: print('Database')) \
218
+ .build() \
219
+ .item() \
220
+ .icon(DashboardIcons.EXIT) \
221
+ .tooltip('Exit application') \
222
+ .on_trigger(lambda: print('Exit')) \
223
+ .build() \
224
+ .build()
225
+ # fmt: on
226
+
227
+ result = mdashboard(dashboard_items)
228
+ ```
229
+
230
+ ![MenuDashboard](https://iili.io/HYBFX2f.png "MenuDashboard")
231
+
232
+ > And even more, create beautiful menus !
233
+
234
+ ```bash
235
+ if __name__ == "__main__":
236
+ # fmt: off
237
+ main_menu = TUIMenuFactory \
238
+ .create_main_menu('TUI Main Menu', tooltip='Test Terminal UI Menus') \
239
+ .with_item('Sub-Menu-1') \
240
+ .with_action("DO IT 1", "Let's do it") \
241
+ .on_trigger(lambda x: print("ACTION 1", x)) \
242
+ .with_view("Just a View 1", "Show the view 1") \
243
+ .on_render("MY BEAUTIFUL VIEW 1") \
244
+ .with_action("Back", "Back to the previous menu") \
245
+ .on_trigger(TUIMenuUi.back) \
246
+ .then() \
247
+ .with_item('Sub-Menu-2') \
248
+ .with_action("DO IT 2", "Let's do it too") \
249
+ .on_trigger(lambda x: print("ACTION 2", x)) \
250
+ .with_view("Just a View 2", "Show the view 2") \
251
+ .on_render("MY BEAUTIFUL VIEW 2") \
252
+ .with_action("Back", "Back to the previous menu") \
253
+ .on_trigger(TUIMenuUi.back) \
254
+ .then() \
255
+ .then() \
256
+ .build()
257
+ # fmt: on
258
+
259
+ TUIMenuUi(main_menu, "TUI Main Menu").execute()
260
+ ```
261
+
262
+ ![Menus](https://iili.io/JAGQJkJ.png "Menus")
263
+
264
+ ## PyPi Modules
265
+
266
+ - [A CLI Terminal](https://pypi.org/project/hspylib-clitt) tools.
267
+ - [Datasource](https://pypi.org/project/hspylib-datasource) framework.
268
+ - [A Firebase](https://pypi.org/project/hspylib-firebase) integration tool.
269
+ - [A PyQt](https://pypi.org/project/hspylib-hqt) application framework.
270
+ - [Core](https://pypi.org/project/hspylib) HomeSetup library.
271
+ - [A Kafka manager](https://pypi.org/project/hspylib-kafman) application tool.
272
+ - [A System Settings](https://pypi.org/project/hspylib-kafman) application tool.
273
+ - [A Vault](https://pypi.org/project/hspylib-vault) application tool.
274
+
275
+ ## Installation
276
+
277
+ ### Requirements
278
+
279
+ #### Python
280
+
281
+ - Python 3.10 and higher
282
+
283
+ #### Operating Systems
284
+
285
+ - Darwin
286
+ + High Sierra and higher
287
+ - Linux
288
+ + Ubuntu 16 and higher
289
+ + CentOS 7 and higher
290
+ + Fedora 31 and higher
291
+
292
+ You may want to install HsPyLib on other OS's and it will probably work, but there are no guarantees that it
293
+ **WILL ACTUALLY WORK**.
294
+
295
+ #### Required software
296
+
297
+ The following software are required:
298
+
299
+ - Git (To clone the github repository)
300
+ - Gradle (To build the HsPyLib project)
301
+
302
+ There are some python dependencies, but they will be automatically downloaded when the build runs.
303
+
304
+ ### PyPi
305
+
306
+ To install HsPyLib from PyPi issue the command:
307
+
308
+ `# python3 -m pip install hspylib`
309
+
310
+ To upgrade HsPyLib use the command:
311
+
312
+ `# python3 -m pip install hspylib --upgrade`
313
+
314
+ Additional modules that can also be installed:
315
+
316
+ - [CLItt](https://pypi.org/project/hspylib-clitt) : `# python3 -m pip install hspylib-clitt` to install HsPyLib CLI terminal tools.
317
+ - [Firebase](https://pypi.org/project/hspylib-firebase) : `# python3 -m pip install hspylib-firebase` to install HsPyLib Firebase application.
318
+ - [Vault](https://pypi.org/project/hspylib-vault) : `# python3 -m pip install hspylib-vault` to install HsPyLib Vault application.
319
+ - [Kafman](https://pypi.org/project/hspylib-kafman) : `# python3 -m pip install hspylib-kafman` to install Kafka manager.
320
+ - [Datasource](https://pypi.org/project/hspylib-datasource) : `# python3 -m pip install hspylib-datasource` to install datasource helpers.
321
+ - [HQT](https://pypi.org/project/hspylib-hqt) : `# python3 -m pip install hspylib-hqt` to install HsPyLib PyQt framework.
322
+
323
+ ### GitHub
324
+
325
+ To clone HsPyLib into your local machine type the command:
326
+
327
+ `# git clone https://github.com/yorevs/hspylib.git`
328
+
329
+ ## Documentation
330
+
331
+ The API documentation can be found [here](docs/api/index.html)
332
+
333
+ ## Support
334
+
335
+ > Your support and contributions are greatly appreciated in helping us improve and enhance HomeSetup. Together, we can
336
+ make it even better!
337
+
338
+ You can support HomeSetup by [donating](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=J5CDEFLF6M3H4)
339
+ or contributing code. Feel free to contact me for further details. When making code contributions, please make sure to
340
+ review our [guidelines](docs/CONTRIBUTING.md) and adhere to our [code of conduct](docs/CODE_OF_CONDUCT.md).
341
+
342
+ [!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/yorevs)
343
+
344
+ You can also sponsor it by using our [GitHub Sponsors](https://github.com/sponsors/yorevs) page.
345
+
346
+ This project is already supported by:
347
+
348
+ <a href="https://www.jetbrains.com/community/opensource/?utm_campaign=opensource&utm_content=approved&utm_medium=email&utm_source=newsletter&utm_term=jblogo#support">
349
+ <img src="https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.png" width="120" height="120">
350
+ </a>
351
+
352
+ Thank you <3 !!
353
+
354
+ ## Known Issues
355
+
356
+ - [In-Progress] We are aware that there is a problems when using python@3.12 and we are already working on a fix.
357
+
358
+ ## Contacts
359
+
360
+ - Documentation: [API](docs/api/index.html)
361
+ - License: [MIT](LICENSE.md)
362
+ - Issue tracker: [HSPyLib-Issues](https://github.com/yorevs/hspylib/issues)
363
+ - Official chat: [HSPyLib](https://gitter.im/hspylib/community)
364
+ - Contact: [yorevs](https://www.reddit.com/user/yorevs)
365
+ - Mailto: [yorevs](mailto:yorevs@hotmail.com)
@@ -0,0 +1,319 @@
1
+ <img src="https://iili.io/HYBJFA7.png" width="64" height="64" align="right" />
2
+
3
+ # HomeSetup Python Library
4
+ >
5
+ > Because your Python code is not JUST a script !
6
+
7
+ [![PyPi](https://badgen.net/badge/icon/python?icon=pypi&label)](https://pypi.org/project/hspylib)
8
+ [![Gitter](https://badgen.net/badge/icon/gitter?icon=gitter&label)](https://gitter.im/hspylib/community)
9
+ [![Donate](https://badgen.net/badge/paypal/donate/yellow)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=J5CDEFLF6M3H4)
10
+ [![License](https://badgen.net/badge/license/MIT/gray)](LICENSE.md)
11
+ [![Release](https://badgen.net/badge/release/v0.9.147/gray)](docs/CHANGELOG.md#unreleased)
12
+ [![build-and-test](https://github.com/yorevs/hspylib/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/yorevs/hspylib/actions/workflows/build-and-test.yml)
13
+
14
+ HsPyLib is not just a Python library; it's a gateway to elevating your programming experience to new heights. Built on
15
+ established principles like **SOLID**, **DRY** (Don't Repeat Yourself), **KISS** (Keep It Simple, Stupid), and **YAGNI**
16
+ (You Ain’t Gonna Need It), HsPyLib offers a wealth of frameworks and features. It empowers you to craft sophisticated
17
+ Python3 applications, adhering to the philosophy that code should not merely be a simple script - it should be a part
18
+ of the 'PYCSNBASS' (Python Code Should Not Be A Simple Script) mindset.
19
+
20
+ > This project is a part of the [HomeSetup](https://github.com/yorevs/homesetup) project.
21
+
22
+ ## Key Features
23
+
24
+ - Seamless installation process.
25
+ - Application manager offering a helpful scaffold for Python applications.
26
+ - Widgets manager for running both 'built-in' and custom Python widgets.
27
+ - Improved TUI (Text User Interface) helpers and input methods to enhance your User Experience with terminal applications.
28
+ - CRUD (Create, Read, Update, Delete) framework aiding with databases, repositories, and services.
29
+ - HTTP request helpers for simplified communication.
30
+ - Support for enabling Properties and AppConfigs using popular extensions like .properties, toml, yml, and more.
31
+ - Code rigorously tested and consistently adhering to Pylint standards.
32
+ - Utilizes the Gradle build system with numerous extensions.
33
+ - Diverse set of demos to facilitate a deeper understanding of the library.
34
+ - AI model integrations (currently supporting OpenAI).
35
+
36
+ > Create beautiful menu-select inputs
37
+
38
+ ```python
39
+ class SelectableItem:
40
+ def __init__(self, name: str, value: str):
41
+ self.name = name
42
+ self.value = value
43
+
44
+ def __str__(self):
45
+ return f"Name: {self.name} Value: {self.value}"
46
+
47
+ def __repr__(self):
48
+ return str(self)
49
+
50
+
51
+ if __name__ == "__main__":
52
+ quantity = 22
53
+ digits = len(str(quantity))
54
+ it = [SelectableItem(f"Item-{n:>0{digits}}", f"Value-{n:>0{digits}}") for n in range(1, quantity)]
55
+ sel = mselect(it)
56
+ print(str(sel))
57
+ ```
58
+
59
+ ![MenuSelect](https://iili.io/HYBFh74.png "MenuSelect")
60
+
61
+ > And create beautiful menu-choose inputs
62
+
63
+ ```python
64
+ class ChooseableItem:
65
+ def __init__(self, name: str, value: str):
66
+ self.name = name
67
+ self.value = value
68
+
69
+ def __str__(self):
70
+ return f"Name: {self.name} Value: {self.value}"
71
+
72
+ def __repr__(self):
73
+ return str(self)
74
+
75
+
76
+ if __name__ == "__main__":
77
+ quantity = 22
78
+ digits = len(str(quantity))
79
+ it = [ChooseableItem(f"Item-{n:>0{digits}}", f"Value-{n:>0{digits}}") for n in range(1, quantity)]
80
+ sel = mchoose(it, [n % 2 == 0 for n in range(1, quantity)])
81
+ print(str(sel))
82
+ ```
83
+
84
+ ![MenuChoose](https://iili.io/HYBFwp2.png "MenuChoose")
85
+
86
+ > And also, create beautiful form inputs
87
+
88
+ ```python
89
+ from clitt.core.tui.minput.input_validator import InputValidator
90
+ from clitt.core.tui.minput.minput import MenuInput, minput
91
+
92
+ if __name__ == "__main__":
93
+ # fmt: off
94
+ form_fields = MenuInput.builder() \
95
+ .field() \
96
+ .label('letters') \
97
+ .validator(InputValidator.letters()) \
98
+ .build() \
99
+ .field() \
100
+ .label('word') \
101
+ .validator(InputValidator.words()) \
102
+ .build() \
103
+ .field() \
104
+ .label('number') \
105
+ .validator(InputValidator.numbers()) \
106
+ .min_max_length(1, 4) \
107
+ .build() \
108
+ .field() \
109
+ .label('masked') \
110
+ .itype('masked') \
111
+ .value('|##::##::## @@') \
112
+ .build() \
113
+ .field() \
114
+ .label('selectable') \
115
+ .itype('select') \
116
+ .value('one|two|three') \
117
+ .build() \
118
+ .field() \
119
+ .label('checkbox') \
120
+ .itype('checkbox') \
121
+ .build() \
122
+ .field() \
123
+ .label('password') \
124
+ .itype('password') \
125
+ .validator(InputValidator.anything()) \
126
+ .min_max_length(4, 8) \
127
+ .build() \
128
+ .field() \
129
+ .label('read-only') \
130
+ .access_type('read-only') \
131
+ .value('READ-ONLY') \
132
+ .build() \
133
+ .build()
134
+ # fmt: on
135
+
136
+ result = minput(form_fields)
137
+ print(result.__dict__ if result else "None")
138
+ ```
139
+
140
+ ![MenuInput](https://iili.io/HYBFVrG.png "MenuInput")
141
+
142
+ > Or even, create nice dashboards:
143
+
144
+ ```python
145
+ if __name__ == "__main__":
146
+ # fmt: off
147
+ dashboard_items = MenuDashBoard.builder() \
148
+ .item() \
149
+ .icon(DashboardIcons.POWER) \
150
+ .tooltip('Do something') \
151
+ .on_trigger(lambda: print('Something')) \
152
+ .build() \
153
+ .item() \
154
+ .icon(DashboardIcons.MOVIE) \
155
+ .tooltip('Another something') \
156
+ .on_trigger(lambda: print('Another')) \
157
+ .build() \
158
+ .item() \
159
+ .icon(DashboardIcons.NOTIFICATION) \
160
+ .tooltip('Notify something') \
161
+ .on_trigger(lambda: print('Notification')) \
162
+ .build() \
163
+ .item() \
164
+ .icon(DashboardIcons.LIST) \
165
+ .tooltip('List everything') \
166
+ .on_trigger(lambda: print('List')) \
167
+ .build() \
168
+ .item() \
169
+ .icon(DashboardIcons.DATABASE) \
170
+ .tooltip('Database console') \
171
+ .on_trigger(lambda: print('Database')) \
172
+ .build() \
173
+ .item() \
174
+ .icon(DashboardIcons.EXIT) \
175
+ .tooltip('Exit application') \
176
+ .on_trigger(lambda: print('Exit')) \
177
+ .build() \
178
+ .build()
179
+ # fmt: on
180
+
181
+ result = mdashboard(dashboard_items)
182
+ ```
183
+
184
+ ![MenuDashboard](https://iili.io/HYBFX2f.png "MenuDashboard")
185
+
186
+ > And even more, create beautiful menus !
187
+
188
+ ```bash
189
+ if __name__ == "__main__":
190
+ # fmt: off
191
+ main_menu = TUIMenuFactory \
192
+ .create_main_menu('TUI Main Menu', tooltip='Test Terminal UI Menus') \
193
+ .with_item('Sub-Menu-1') \
194
+ .with_action("DO IT 1", "Let's do it") \
195
+ .on_trigger(lambda x: print("ACTION 1", x)) \
196
+ .with_view("Just a View 1", "Show the view 1") \
197
+ .on_render("MY BEAUTIFUL VIEW 1") \
198
+ .with_action("Back", "Back to the previous menu") \
199
+ .on_trigger(TUIMenuUi.back) \
200
+ .then() \
201
+ .with_item('Sub-Menu-2') \
202
+ .with_action("DO IT 2", "Let's do it too") \
203
+ .on_trigger(lambda x: print("ACTION 2", x)) \
204
+ .with_view("Just a View 2", "Show the view 2") \
205
+ .on_render("MY BEAUTIFUL VIEW 2") \
206
+ .with_action("Back", "Back to the previous menu") \
207
+ .on_trigger(TUIMenuUi.back) \
208
+ .then() \
209
+ .then() \
210
+ .build()
211
+ # fmt: on
212
+
213
+ TUIMenuUi(main_menu, "TUI Main Menu").execute()
214
+ ```
215
+
216
+ ![Menus](https://iili.io/JAGQJkJ.png "Menus")
217
+
218
+ ## PyPi Modules
219
+
220
+ - [A CLI Terminal](https://pypi.org/project/hspylib-clitt) tools.
221
+ - [Datasource](https://pypi.org/project/hspylib-datasource) framework.
222
+ - [A Firebase](https://pypi.org/project/hspylib-firebase) integration tool.
223
+ - [A PyQt](https://pypi.org/project/hspylib-hqt) application framework.
224
+ - [Core](https://pypi.org/project/hspylib) HomeSetup library.
225
+ - [A Kafka manager](https://pypi.org/project/hspylib-kafman) application tool.
226
+ - [A System Settings](https://pypi.org/project/hspylib-kafman) application tool.
227
+ - [A Vault](https://pypi.org/project/hspylib-vault) application tool.
228
+
229
+ ## Installation
230
+
231
+ ### Requirements
232
+
233
+ #### Python
234
+
235
+ - Python 3.10 and higher
236
+
237
+ #### Operating Systems
238
+
239
+ - Darwin
240
+ + High Sierra and higher
241
+ - Linux
242
+ + Ubuntu 16 and higher
243
+ + CentOS 7 and higher
244
+ + Fedora 31 and higher
245
+
246
+ You may want to install HsPyLib on other OS's and it will probably work, but there are no guarantees that it
247
+ **WILL ACTUALLY WORK**.
248
+
249
+ #### Required software
250
+
251
+ The following software are required:
252
+
253
+ - Git (To clone the github repository)
254
+ - Gradle (To build the HsPyLib project)
255
+
256
+ There are some python dependencies, but they will be automatically downloaded when the build runs.
257
+
258
+ ### PyPi
259
+
260
+ To install HsPyLib from PyPi issue the command:
261
+
262
+ `# python3 -m pip install hspylib`
263
+
264
+ To upgrade HsPyLib use the command:
265
+
266
+ `# python3 -m pip install hspylib --upgrade`
267
+
268
+ Additional modules that can also be installed:
269
+
270
+ - [CLItt](https://pypi.org/project/hspylib-clitt) : `# python3 -m pip install hspylib-clitt` to install HsPyLib CLI terminal tools.
271
+ - [Firebase](https://pypi.org/project/hspylib-firebase) : `# python3 -m pip install hspylib-firebase` to install HsPyLib Firebase application.
272
+ - [Vault](https://pypi.org/project/hspylib-vault) : `# python3 -m pip install hspylib-vault` to install HsPyLib Vault application.
273
+ - [Kafman](https://pypi.org/project/hspylib-kafman) : `# python3 -m pip install hspylib-kafman` to install Kafka manager.
274
+ - [Datasource](https://pypi.org/project/hspylib-datasource) : `# python3 -m pip install hspylib-datasource` to install datasource helpers.
275
+ - [HQT](https://pypi.org/project/hspylib-hqt) : `# python3 -m pip install hspylib-hqt` to install HsPyLib PyQt framework.
276
+
277
+ ### GitHub
278
+
279
+ To clone HsPyLib into your local machine type the command:
280
+
281
+ `# git clone https://github.com/yorevs/hspylib.git`
282
+
283
+ ## Documentation
284
+
285
+ The API documentation can be found [here](docs/api/index.html)
286
+
287
+ ## Support
288
+
289
+ > Your support and contributions are greatly appreciated in helping us improve and enhance HomeSetup. Together, we can
290
+ make it even better!
291
+
292
+ You can support HomeSetup by [donating](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=J5CDEFLF6M3H4)
293
+ or contributing code. Feel free to contact me for further details. When making code contributions, please make sure to
294
+ review our [guidelines](docs/CONTRIBUTING.md) and adhere to our [code of conduct](docs/CODE_OF_CONDUCT.md).
295
+
296
+ [!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/yorevs)
297
+
298
+ You can also sponsor it by using our [GitHub Sponsors](https://github.com/sponsors/yorevs) page.
299
+
300
+ This project is already supported by:
301
+
302
+ <a href="https://www.jetbrains.com/community/opensource/?utm_campaign=opensource&utm_content=approved&utm_medium=email&utm_source=newsletter&utm_term=jblogo#support">
303
+ <img src="https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.png" width="120" height="120">
304
+ </a>
305
+
306
+ Thank you <3 !!
307
+
308
+ ## Known Issues
309
+
310
+ - [In-Progress] We are aware that there is a problems when using python@3.12 and we are already working on a fix.
311
+
312
+ ## Contacts
313
+
314
+ - Documentation: [API](docs/api/index.html)
315
+ - License: [MIT](LICENSE.md)
316
+ - Issue tracker: [HSPyLib-Issues](https://github.com/yorevs/hspylib/issues)
317
+ - Official chat: [HSPyLib](https://gitter.im/hspylib/community)
318
+ - Contact: [yorevs](https://www.reddit.com/user/yorevs)
319
+ - Mailto: [yorevs](mailto:yorevs@hotmail.com)
@@ -0,0 +1 @@
1
+ 0.9.147