ttykit 0.3.7__tar.gz → 0.5.0__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 (40) hide show
  1. ttykit-0.5.0/PKG-INFO +189 -0
  2. ttykit-0.5.0/README.md +78 -0
  3. ttykit-0.5.0/README.pypi.md +151 -0
  4. {ttykit-0.3.7 → ttykit-0.5.0}/pyproject.toml +5 -4
  5. ttykit-0.5.0/src/ttykit/__init__.py +65 -0
  6. {ttykit-0.3.7 → ttykit-0.5.0}/src/ttykit/console/TUI.py +5 -1
  7. {ttykit-0.3.7 → ttykit-0.5.0}/src/ttykit/console/console.py +95 -74
  8. ttykit-0.5.0/src/ttykit/console/input/__init__.py +90 -0
  9. ttykit-0.5.0/src/ttykit/console/input/_local.py +39 -0
  10. ttykit-0.5.0/src/ttykit/console/input/_unix.py +161 -0
  11. ttykit-0.5.0/src/ttykit/console/input/_windows.py +249 -0
  12. ttykit-0.5.0/src/ttykit/data/__init__.py +15 -0
  13. {ttykit-0.3.7/src/ttykit → ttykit-0.5.0/src/ttykit/data}/_state.py +50 -1
  14. ttykit-0.5.0/src/ttykit/data/const.py +263 -0
  15. ttykit-0.5.0/src/ttykit/data/dataclass.py +13 -0
  16. ttykit-0.5.0/src/ttykit/examples/progressbar.py +14 -0
  17. {ttykit-0.3.7/src/ttykit → ttykit-0.5.0/src/ttykit/examples}/spinner.py +2 -2
  18. {ttykit-0.3.7 → ttykit-0.5.0}/src/ttykit/progress.py +26 -6
  19. ttykit-0.5.0/src/ttykit/segmentation.py +97 -0
  20. {ttykit-0.3.7 → ttykit-0.5.0}/src/ttykit/status.py +23 -19
  21. ttykit-0.5.0/src/ttykit/tree.py +58 -0
  22. ttykit-0.5.0/src/ttykit/utils/__init__.py +16 -0
  23. ttykit-0.5.0/src/ttykit/utils/exceptions.py +18 -0
  24. ttykit-0.5.0/src/ttykit/utils/utils.py +38 -0
  25. ttykit-0.5.0/src/ttykit/utils/warnings.py +8 -0
  26. ttykit-0.5.0/src/ttykit.egg-info/PKG-INFO +189 -0
  27. ttykit-0.5.0/src/ttykit.egg-info/SOURCES.txt +31 -0
  28. ttykit-0.5.0/src/ttykit.egg-info/entry_points.txt +3 -0
  29. {ttykit-0.3.7 → ttykit-0.5.0}/src/ttykit.egg-info/requires.txt +0 -1
  30. ttykit-0.3.7/PKG-INFO +0 -105
  31. ttykit-0.3.7/README.md +0 -66
  32. ttykit-0.3.7/src/ttykit/__init__.py +0 -69
  33. ttykit-0.3.7/src/ttykit/console/const.py +0 -18
  34. ttykit-0.3.7/src/ttykit.egg-info/PKG-INFO +0 -105
  35. ttykit-0.3.7/src/ttykit.egg-info/SOURCES.txt +0 -17
  36. ttykit-0.3.7/src/ttykit.egg-info/entry_points.txt +0 -2
  37. {ttykit-0.3.7 → ttykit-0.5.0}/LICENSE +0 -0
  38. {ttykit-0.3.7 → ttykit-0.5.0}/setup.cfg +0 -0
  39. {ttykit-0.3.7 → ttykit-0.5.0}/src/ttykit.egg-info/dependency_links.txt +0 -0
  40. {ttykit-0.3.7 → ttykit-0.5.0}/src/ttykit.egg-info/top_level.txt +0 -0
ttykit-0.5.0/PKG-INFO ADDED
@@ -0,0 +1,189 @@
1
+ Metadata-Version: 2.4
2
+ Name: ttykit
3
+ Version: 0.5.0
4
+ Summary: Helping made beatiful out in terminal
5
+ Author: He-STALIN
6
+ Author-email: hene.stalin@gmail.com
7
+ License: MIT License
8
+
9
+ Copyright (c) 2026 _STALIN_
10
+
11
+ Permission is hereby granted, free of charge, to any person obtaining a copy
12
+ of this software and associated documentation files (the "Software"), to deal
13
+ in the Software without restriction, including without limitation the rights
14
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
+ copies of the Software, and to permit persons to whom the Software is
16
+ furnished to do so, subject to the following conditions:
17
+
18
+ The above copyright notice and this permission notice shall be included in all
19
+ copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
+ SOFTWARE.
28
+
29
+ Project-URL: Homepage, https://github.com/He-STALIN/ttykit
30
+ Project-URL: BugTracker, https://github.com/He-STALIN/ttykit/issues
31
+ Keywords: tty,terminal,formatting
32
+ Requires-Python: >=3.13
33
+ Description-Content-Type: text/markdown
34
+ License-File: LICENSE
35
+ Provides-Extra: test
36
+ Requires-Dist: pytest; extra == "test"
37
+ Dynamic: license-file
38
+
39
+ <div align="center">
40
+
41
+ # TTYKit
42
+
43
+ > **Helping made beautiful out in terminal**
44
+
45
+ [![Python Version](https://img.shields.io/badge/python-3.13+-blue.svg)](https://python.org)
46
+ [![GitHub license](https://img.shields.io/github/license/He-STALIN/ttykit)](https://github.com/He-STALIN/ttykit/blob/main/LICENSE)
47
+ [![Repository](https://img.shields.io/badge/Repository-GitHub-4b93ff?style=flat&logo=github&logoColor=white)](https://github.com/He-STALIN/ttykit)
48
+ [![Downloads](https://img.shields.io/pypi/dm/ttykit)](https://pypi.org/project/ttykit/)
49
+
50
+ </div>
51
+
52
+ ## This file is 2-lang
53
+ - [EN Version](#en)
54
+ - [RU Версия](#ru)
55
+
56
+
57
+ ## EN
58
+ ### For Start
59
+ - #### Automatic
60
+ - exec `pip install ttykit`
61
+
62
+ - #### Manually
63
+ - #### Dev version
64
+ - clone repository
65
+ ```bash
66
+ git clone https://github.com/He-STALIN/ttykit.git
67
+ ```
68
+
69
+ - change to dir and exec
70
+ ```bash
71
+ pip install .
72
+ ```
73
+
74
+ - #### From Release
75
+ - download any release from [Releases](https://github.com/He-STALIN/ttykit/releases)
76
+
77
+ - exec in terminal
78
+ ```bash
79
+ pip install <path>
80
+ ```
81
+ where `<path>` you need write path to the downloaded release file
82
+
83
+ ### support the project
84
+ - If you would like the project to continue developing, you can make a [donation](https://yoomoney.ru/to/4100118618732284/100).
85
+ - Account: `4100 1186 1873 2284` (YouMoney)
86
+ - or
87
+ - Find bugs in the library and report them in the [`issues` section on GitHub](https://github.com/He-STALIN/ttykit/issues).
88
+
89
+ ### Code Examples
90
+ - #### Status
91
+ ```python
92
+ from ttykit import Status, TaskState
93
+
94
+ with Status("Something unit", spinner="line") as status:
95
+ ... # your payload
96
+ status.set_state(TaskState.SUCCESS)
97
+ ```
98
+
99
+ - #### Progress
100
+ ```python
101
+ from ttykit import Progress
102
+
103
+ with Progress(100, "Some desc", 40) as progress:
104
+ ... # your code
105
+ progress.update(value)
106
+ ... # your code again
107
+ progress.finish()
108
+ ```
109
+
110
+ - **for more code examples see** [CODE USE](https://github.com/He-STALIN/ttykit/blob/main/docs/en/CODE_USE.md)
111
+
112
+
113
+ ### License
114
+ - This lib uploading with MIT License. [See License](https://github.com/He-STALIN/ttykit/blob/main/LICENSE)
115
+
116
+ ### Versions
117
+ - You interesting see versions? You can see [CHANGELOG](https://github.com/He-STALIN/ttykit/blob/main/docs/en/CHANGELOG.md)
118
+
119
+
120
+ ## RU
121
+ ### Для начала использования
122
+ - #### Авто-установка
123
+ - выполните `pip install ttykit` в терминале
124
+
125
+ - #### Вручную
126
+ - #### Разрабатываемую версию
127
+ - скопируйте репозиторий
128
+ ```bash
129
+ git clone https://github.com/He-STALIN/ttykit.git
130
+ ```
131
+
132
+ - перейдите в папку и выполни
133
+ ```bash
134
+ pip install .
135
+ ```
136
+ - #### Релизную версию
137
+ - Скачайте любой релиз из вкладки ["Releases"](https://github.com/He-STALIN/ttykit/releases)
138
+
139
+ - выполните в терминале
140
+ ```bash
141
+ pip install <path>
142
+ ```
143
+ Где `<path>` вам нужно вставить путь к скачанному файлу релиза
144
+
145
+
146
+ ### Поддержите проект
147
+ - Если вы желаете, чтобы проект разрабатывался дальше, вы можете сделать [пожертвование](https://yoomoney.ru/to/4100118618732284/100).
148
+ - Счет: `4100 1186 1873 2284` (ЮМани)
149
+ - или
150
+ - Ищите ошибки в библиотеке и сообщайте о них в [`issues` на GitHub](https://github.com/He-STALIN/ttykit/issues).
151
+
152
+
153
+ ### Примеры кода
154
+ - #### Status класс
155
+ ```python
156
+ from ttykit import Status, TaskState
157
+
158
+ with Status("Какая-то задача", spinner="line") as status:
159
+ ... # ваша нагрузка
160
+ status.set_state(TaskState.SUCCESS)
161
+ ```
162
+
163
+ - #### Progress класс
164
+ ```python
165
+ from ttykit import Progress
166
+
167
+ with Progress(100, "Некоторое описание", 40) as progress:
168
+ ... # ваш код
169
+ progress.update(value)
170
+ ... # и снова ваш код
171
+ progress.finish()
172
+ ```
173
+
174
+ - **Для большего количества примеров и описания смотрите** [CODE USE](https://github.com/He-STALIN/ttykit/blob/main/docs/ru/CODE_USE.md)
175
+
176
+
177
+ ### Лицензия
178
+ - Это библиотека распространяется под лицензией MIT. [Смотреть лицензию](https://github.com/He-STALIN/ttykit/blob/main/LICENSE)
179
+
180
+ ### Версии
181
+ - вам интересно узнать про версии? Вы можете посмотреть [CHANGELOG](https://github.com/He-STALIN/ttykit/blob/main/docs/ru/CHANGELOG.md)
182
+
183
+
184
+ ---
185
+ <div align="center">
186
+
187
+ *ttykit by He_STALIN. All rights reserved*
188
+
189
+ </div>
ttykit-0.5.0/README.md ADDED
@@ -0,0 +1,78 @@
1
+ <div align="center">
2
+
3
+ # TTYKit
4
+
5
+ > **Helping made beautiful out in terminal**
6
+
7
+ [![Python Version](https://img.shields.io/badge/python-3.13+-blue.svg)](https://python.org)
8
+ [![GitHub license](https://img.shields.io/github/license/He-STALIN/ttykit)](LICENSE)
9
+ [![Repository](https://img.shields.io/badge/Repository-GitHub-4b93ff?style=flat&logo=github&logoColor=white)](https://github.com/He-STALIN/ttykit)
10
+ [![Downloads](https://img.shields.io/pypi/dm/ttykit)](https://pypi.org/project/ttykit/)
11
+
12
+ </div>
13
+
14
+ ##### Вы из России? Смотрите [русскую версию](/docs/ru/README.ru.md)
15
+
16
+ ---
17
+
18
+ ## For Start
19
+ ### Manually:
20
+ - Clone repository
21
+ ```bash
22
+ git clone https://github.com/He-STALIN/ttykit.git
23
+ ```
24
+
25
+ - Change dir and exec
26
+ ```bash
27
+ pip install .
28
+ ```
29
+ ### Auto
30
+ - exec `pip install ttykit`
31
+
32
+ - And use in your projects!
33
+
34
+ ## Support the project
35
+ - If you would like the project to continue developing, you can make a [donation](https://yoomoney.ru/to/4100118618732284/100).
36
+ - Account: `4100 1186 1873 2284` (YouMoney)
37
+ - or
38
+ - Find bugs in the library and report them in the `issues` section on GitHub.
39
+
40
+ ## Code Examples
41
+
42
+ - ### Status
43
+ ```python
44
+ from ttykit import Status, TaskState
45
+
46
+ with Status("Something unit", spinner="line") as status:
47
+ <some action>
48
+ status.set_state(TaskState.SUCCESS)
49
+ ```
50
+
51
+ - ### Progress
52
+ ```python
53
+ from ttykit import Progress
54
+
55
+ with Progress(100, "Some desc", 40) as progress:
56
+ <some action>
57
+ progress.update(<value>)
58
+ <some action again>
59
+ progress.finish()
60
+ ```
61
+
62
+ - **for more code examples see** [CODE USE](docs/en/CODE_USE.md)
63
+
64
+ ## Also
65
+ - also you can use prepared colors in this lib
66
+
67
+ ## License
68
+ - This lib uploading with MIT License. [See License](LICENSE)
69
+
70
+ ## Versions
71
+ - You interesting see versions? You can see [CHANGELOG](docs/en/CHANGELOG.md)
72
+
73
+ ---
74
+ <div align="center">
75
+
76
+ *ttykit by He_STALIN. All right reserved*
77
+
78
+ </div>
@@ -0,0 +1,151 @@
1
+ <div align="center">
2
+
3
+ # TTYKit
4
+
5
+ > **Helping made beautiful out in terminal**
6
+
7
+ [![Python Version](https://img.shields.io/badge/python-3.13+-blue.svg)](https://python.org)
8
+ [![GitHub license](https://img.shields.io/github/license/He-STALIN/ttykit)](https://github.com/He-STALIN/ttykit/blob/main/LICENSE)
9
+ [![Repository](https://img.shields.io/badge/Repository-GitHub-4b93ff?style=flat&logo=github&logoColor=white)](https://github.com/He-STALIN/ttykit)
10
+ [![Downloads](https://img.shields.io/pypi/dm/ttykit)](https://pypi.org/project/ttykit/)
11
+
12
+ </div>
13
+
14
+ ## This file is 2-lang
15
+ - [EN Version](#en)
16
+ - [RU Версия](#ru)
17
+
18
+
19
+ ## EN
20
+ ### For Start
21
+ - #### Automatic
22
+ - exec `pip install ttykit`
23
+
24
+ - #### Manually
25
+ - #### Dev version
26
+ - clone repository
27
+ ```bash
28
+ git clone https://github.com/He-STALIN/ttykit.git
29
+ ```
30
+
31
+ - change to dir and exec
32
+ ```bash
33
+ pip install .
34
+ ```
35
+
36
+ - #### From Release
37
+ - download any release from [Releases](https://github.com/He-STALIN/ttykit/releases)
38
+
39
+ - exec in terminal
40
+ ```bash
41
+ pip install <path>
42
+ ```
43
+ where `<path>` you need write path to the downloaded release file
44
+
45
+ ### support the project
46
+ - If you would like the project to continue developing, you can make a [donation](https://yoomoney.ru/to/4100118618732284/100).
47
+ - Account: `4100 1186 1873 2284` (YouMoney)
48
+ - or
49
+ - Find bugs in the library and report them in the [`issues` section on GitHub](https://github.com/He-STALIN/ttykit/issues).
50
+
51
+ ### Code Examples
52
+ - #### Status
53
+ ```python
54
+ from ttykit import Status, TaskState
55
+
56
+ with Status("Something unit", spinner="line") as status:
57
+ ... # your payload
58
+ status.set_state(TaskState.SUCCESS)
59
+ ```
60
+
61
+ - #### Progress
62
+ ```python
63
+ from ttykit import Progress
64
+
65
+ with Progress(100, "Some desc", 40) as progress:
66
+ ... # your code
67
+ progress.update(value)
68
+ ... # your code again
69
+ progress.finish()
70
+ ```
71
+
72
+ - **for more code examples see** [CODE USE](https://github.com/He-STALIN/ttykit/blob/main/docs/en/CODE_USE.md)
73
+
74
+
75
+ ### License
76
+ - This lib uploading with MIT License. [See License](https://github.com/He-STALIN/ttykit/blob/main/LICENSE)
77
+
78
+ ### Versions
79
+ - You interesting see versions? You can see [CHANGELOG](https://github.com/He-STALIN/ttykit/blob/main/docs/en/CHANGELOG.md)
80
+
81
+
82
+ ## RU
83
+ ### Для начала использования
84
+ - #### Авто-установка
85
+ - выполните `pip install ttykit` в терминале
86
+
87
+ - #### Вручную
88
+ - #### Разрабатываемую версию
89
+ - скопируйте репозиторий
90
+ ```bash
91
+ git clone https://github.com/He-STALIN/ttykit.git
92
+ ```
93
+
94
+ - перейдите в папку и выполни
95
+ ```bash
96
+ pip install .
97
+ ```
98
+ - #### Релизную версию
99
+ - Скачайте любой релиз из вкладки ["Releases"](https://github.com/He-STALIN/ttykit/releases)
100
+
101
+ - выполните в терминале
102
+ ```bash
103
+ pip install <path>
104
+ ```
105
+ Где `<path>` вам нужно вставить путь к скачанному файлу релиза
106
+
107
+
108
+ ### Поддержите проект
109
+ - Если вы желаете, чтобы проект разрабатывался дальше, вы можете сделать [пожертвование](https://yoomoney.ru/to/4100118618732284/100).
110
+ - Счет: `4100 1186 1873 2284` (ЮМани)
111
+ - или
112
+ - Ищите ошибки в библиотеке и сообщайте о них в [`issues` на GitHub](https://github.com/He-STALIN/ttykit/issues).
113
+
114
+
115
+ ### Примеры кода
116
+ - #### Status класс
117
+ ```python
118
+ from ttykit import Status, TaskState
119
+
120
+ with Status("Какая-то задача", spinner="line") as status:
121
+ ... # ваша нагрузка
122
+ status.set_state(TaskState.SUCCESS)
123
+ ```
124
+
125
+ - #### Progress класс
126
+ ```python
127
+ from ttykit import Progress
128
+
129
+ with Progress(100, "Некоторое описание", 40) as progress:
130
+ ... # ваш код
131
+ progress.update(value)
132
+ ... # и снова ваш код
133
+ progress.finish()
134
+ ```
135
+
136
+ - **Для большего количества примеров и описания смотрите** [CODE USE](https://github.com/He-STALIN/ttykit/blob/main/docs/ru/CODE_USE.md)
137
+
138
+
139
+ ### Лицензия
140
+ - Это библиотека распространяется под лицензией MIT. [Смотреть лицензию](https://github.com/He-STALIN/ttykit/blob/main/LICENSE)
141
+
142
+ ### Версии
143
+ - вам интересно узнать про версии? Вы можете посмотреть [CHANGELOG](https://github.com/He-STALIN/ttykit/blob/main/docs/ru/CHANGELOG.md)
144
+
145
+
146
+ ---
147
+ <div align="center">
148
+
149
+ *ttykit by He_STALIN. All rights reserved*
150
+
151
+ </div>
@@ -8,7 +8,7 @@ include = ["ttykit*"]
8
8
 
9
9
  [project]
10
10
  name = "ttykit"
11
- version = "0.3.7"
11
+ version = "0.5.0"
12
12
  description = "Helping made beatiful out in terminal"
13
13
  requires-python = ">=3.13"
14
14
  authors = [
@@ -16,12 +16,13 @@ authors = [
16
16
  {email = "hene.stalin@gmail.com"}
17
17
  ]
18
18
  license = {file = "LICENSE"}
19
- readme = "README.md"
19
+ readme = "README.pypi.md"
20
20
  keywords = ['tty', 'terminal', 'formatting']
21
- dependencies = ["keyboard"]
21
+ dependencies = []
22
22
 
23
23
  [project.scripts]
24
- ttykit-spinner = "ttykit.spinner:main"
24
+ ttykit-spinner = "ttykit.examples.spinner:main"
25
+ ttykit-progressbar = "ttykit.examples.progressbar:main"
25
26
 
26
27
  [project.optional-dependencies]
27
28
  test = ["pytest"]
@@ -0,0 +1,65 @@
1
+ """
2
+ ttykit
3
+ =-=-=-=-=-=-=-=-=-=-=-
4
+ Helps produce attractive terminal output.
5
+
6
+ Author: He-STALIN
7
+ License: MIT License
8
+
9
+ Available imports:
10
+ ├─ Classes:
11
+ │ + Progress
12
+ │ + Status
13
+ │ + Tree
14
+ │ + Console
15
+ ├─ Submodules:
16
+ │ + data
17
+ │ - Input
18
+ │ + utils
19
+ ├─ Methods:
20
+ │ + get_console
21
+ └─ In dev/un-ready:
22
+ - TUI (class)
23
+ - Input (submodule)
24
+
25
+ Documentation you can see here:
26
+ https://github.com/He-STALIN/ttykit/tree/main/docs
27
+ """
28
+
29
+ from .console.console import Console
30
+ from .console import input as Input
31
+ from .progress import Progress
32
+ from .console.TUI import TUI
33
+ from .status import Status
34
+ from .tree import Tree
35
+ from . import data, utils
36
+
37
+
38
+ __all__ = [
39
+ 'Progress',
40
+ 'Status',
41
+ 'data',
42
+ 'Console',
43
+ 'Tree',
44
+ 'TUI',
45
+ "Input",
46
+ 'get_console',
47
+ 'utils'
48
+ ]
49
+
50
+ __name__ = 'ttykit'
51
+ __author__ = 'He-STALIN'
52
+ __version__ = '0.5.0'
53
+ __license__ = 'MIT'
54
+
55
+
56
+ console_inst: "Console" = None
57
+
58
+ def get_console() -> 'Console':
59
+ """Return a instance of `Console`"""
60
+ global console_inst
61
+ if console_inst:
62
+ return console_inst
63
+ else:
64
+ console_inst = Console()
65
+ return console_inst
@@ -1,4 +1,5 @@
1
- import keyboard as kb
1
+ from ttykit import Input as kb
2
+ from warnings import warn
2
3
  import os, sys
3
4
 
4
5
 
@@ -41,6 +42,9 @@ class TUI:
41
42
  """
42
43
  def __init__(self, title: str):
43
44
  super().__init__()
45
+
46
+ warn("This class is not actually an interface and will be removed when a full-fledged TUI composer is created.", FutureWarning, stacklevel=2)
47
+
44
48
  self.TITLE: str = title if title else "Text UI"
45
49
  self.FOOTER: str = "For control use arrows Up/Down and Enter to select"
46
50
  self.DEFAULT_SPACE = " "