anb-python-components 1.4.3__tar.gz → 1.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.
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/LICENSE +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/PKG-INFO +148 -148
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/README.md +2 -2
- anb_python_components-1.5.0/anb_python_components/__init__.py +65 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components/classes/__init__.py +8 -7
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components/classes/action_state.py +8 -4
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components/classes/dataclass_analyzer.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components/classes/directory.py +2 -2
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components/classes/file.py +266 -226
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components/classes/interface.py +0 -0
- anb_python_components-1.5.0/anb_python_components/classes/logger.py +223 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components/classes/shortcode_parser.py +194 -194
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components/custom_types/__init__.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components/custom_types/guid.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components/custom_types/object_array.py +29 -29
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components/custom_types/shortcode_attributes.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components/custom_types/two_dim_size.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components/custom_types/version_info.py +464 -460
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components/decorators/__init__.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components/decorators/interface_decorators.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components/enums/__init__.py +0 -0
- anb_python_components-1.5.0/anb_python_components/enums/message_type.py +81 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components/enums/not_bool_action.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components/enums/type_copy_strategy.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components/exceptions/__init__.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components/exceptions/wrong_type_exception.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components/extensions/__init__.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components/extensions/array_extension.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components/extensions/bool_extension.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components/extensions/dataclass_extension.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components/extensions/string_extension.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components/extensions/string_extension_constant.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components/extensions/type_extension.py +0 -0
- anb_python_components-1.5.0/anb_python_components/log_formatters/__init__.py +4 -0
- anb_python_components-1.5.0/anb_python_components/log_formatters/default_log_formatter.py +29 -0
- anb_python_components-1.5.0/anb_python_components/log_formatters/russian_log_formatter.py +44 -0
- anb_python_components-1.5.0/anb_python_components/log_handlers/__init__.py +7 -0
- anb_python_components-1.5.0/anb_python_components/log_handlers/buffered_file_handler.py +137 -0
- anb_python_components-1.5.0/anb_python_components/log_handlers/buffered_rotating_file_handler.py +178 -0
- anb_python_components-1.5.0/anb_python_components/log_handlers/console_handler.py +154 -0
- anb_python_components-1.5.0/anb_python_components/log_handlers/file_handler.py +93 -0
- anb_python_components-1.5.0/anb_python_components/log_handlers/rotating_file_handler.py +135 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components/models/__init__.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components/models/action_state_message.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components/models/shortcode_model.py +0 -0
- anb_python_components-1.5.0/anb_python_components/protocols/__init__.py +4 -0
- anb_python_components-1.5.0/anb_python_components/protocols/i_log_formatter.py +17 -0
- anb_python_components-1.5.0/anb_python_components/protocols/i_log_handler.py +49 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components.egg-info/PKG-INFO +148 -148
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components.egg-info/SOURCES.txt +14 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components.egg-info/dependency_links.txt +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components.egg-info/not-zip-safe +1 -1
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components.egg-info/requires.txt +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/anb_python_components.egg-info/top_level.txt +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/setup.cfg +4 -4
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/setup.py +2 -2
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/tests/__init__.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/tests/classes/__init__.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/tests/classes/action_state_test.py +4 -5
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/tests/classes/dataclass_analyzer_test.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/tests/classes/directory_test.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/tests/classes/file_test.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/tests/classes/interface_test.py +0 -0
- anb_python_components-1.5.0/tests/classes/logger_test.py +336 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/tests/classes/shortcode_parser_test.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/tests/custom_types/__init__.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/tests/custom_types/guid_test.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/tests/custom_types/object_array_test.py +7 -7
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/tests/custom_types/two_dim_size_test.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/tests/custom_types/version_info_test.py +51 -50
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/tests/extensions/__init__.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/tests/extensions/array_extension_test.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/tests/extensions/bool_extension_test.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/tests/extensions/string_extension_test.py +0 -0
- {anb_python_components-1.4.3 → anb_python_components-1.5.0}/tests/extensions/type_extension_test.py +0 -0
- anb_python_components-1.4.3/anb_python_components/__init__.py +0 -46
- anb_python_components-1.4.3/anb_python_components/enums/message_type.py +0 -44
|
File without changes
|
|
@@ -1,148 +1,148 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: anb_python_components
|
|
3
|
-
Version: 1.
|
|
4
|
-
Summary: Набор компонентов Python, которые упрощают разработку / A set of Python components that simplify development
|
|
5
|
-
Home-page: https://gitflic.ru/project/babaev-an/anb-python-components
|
|
6
|
-
Author: Александр Бабаев
|
|
7
|
-
Author-email: contact_with_us@babaev-an.ru
|
|
8
|
-
Project-URL: Documentation, https://gitflic.ru/project/babaev-an/anb-python-components/wiki
|
|
9
|
-
Project-URL: Source, https://gitflic.ru/project/babaev-an/anb-python-components
|
|
10
|
-
Project-URL: Tracker, https://gitflic.ru/project/babaev-an/anb-python-components/issue?page=0
|
|
11
|
-
Keywords: python components development utils
|
|
12
|
-
Classifier: Development Status :: 5 - Production/Stable
|
|
13
|
-
Classifier: Intended Audience :: Developers
|
|
14
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
-
Classifier: Operating System :: OS Independent
|
|
17
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
18
|
-
Requires-Python: >=3.
|
|
19
|
-
Description-Content-Type: text/markdown
|
|
20
|
-
License-File: LICENSE
|
|
21
|
-
Requires-Dist: setuptools>=80.9.0
|
|
22
|
-
Dynamic: author
|
|
23
|
-
Dynamic: author-email
|
|
24
|
-
Dynamic: classifier
|
|
25
|
-
Dynamic: description
|
|
26
|
-
Dynamic: description-content-type
|
|
27
|
-
Dynamic: home-page
|
|
28
|
-
Dynamic: keywords
|
|
29
|
-
Dynamic: license-file
|
|
30
|
-
Dynamic: project-url
|
|
31
|
-
Dynamic: requires-dist
|
|
32
|
-
Dynamic: requires-python
|
|
33
|
-
Dynamic: summary
|
|
34
|
-
|
|
35
|
-
# 📌🇷🇺 Русская версия
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
## Набор компонентов Python для упрощения разработки приложений
|
|
40
|
-
|
|
41
|
-
**ANB Python Components** — это библиотека полезных классов и модулей, предназначенная для ускорения процесса разработки
|
|
42
|
-
программного обеспечения на языке программирования Python. Библиотека включает широкий спектр инструментов, облегчающих
|
|
43
|
-
выполнение повседневных задач разработчика, от обработки файлов и сетевых запросов до автоматизации тестирования и
|
|
44
|
-
интеграции с популярными фреймворками.
|
|
45
|
-
|
|
46
|
-
### ✅ Основные возможности:
|
|
47
|
-
|
|
48
|
-
- Удобные инструменты для работы с файлами и каталогами.
|
|
49
|
-
- Классы для работы с файлами и директориями.
|
|
50
|
-
- Классы для удобной передачи состояния.
|
|
51
|
-
- Новые
|
|
52
|
-
типы [GUID](https://gitflic.ru/project/babaev-an/anb-python-components/wiki/page?file=class_desc%2Fcustom_types%2Fguid.md),
|
|
53
|
-
[TwoDimSize](https://gitflic.ru/project/babaev-an/anb-python-components/wiki/page?file=class_desc%2Fcustom_types%2Ftwo_dim_size.md), [VersionInfo](https://gitflic.ru/project/babaev-an/anb-python-components/wiki/page?file=class_desc%2Fcustom_types%2Fversion_info.md), [ShortCodeAttributes](https://gitflic.ru/project/babaev-an/anb-python-components/wiki/page?file=class_desc%2Fcustom_types%2Fshortcode_attributes.md)
|
|
54
|
-
и [ObjectArray](https://gitflic.ru/project/babaev-an/anb-python-components/wiki/page?file=class_desc%2Fcustom_types%2Fobject_array.md).
|
|
55
|
-
- Расширение массивов, типа `bool`, типа `GUID`, типа `str`.
|
|
56
|
-
- Класс для перевода любого типа в строку и наоборот.
|
|
57
|
-
|
|
58
|
-
### ⚙️ Установка и использование:
|
|
59
|
-
|
|
60
|
-
Установить пакет можно через pip:
|
|
61
|
-
|
|
62
|
-
```bash
|
|
63
|
-
pip install anb-python-components
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
Подключайте необходимые модули и начните пользоваться ими прямо сейчас:
|
|
67
|
-
|
|
68
|
-
```python
|
|
69
|
-
from anb_python_components import TwoDimSize
|
|
70
|
-
|
|
71
|
-
# Пример использования
|
|
72
|
-
two_dim = TwoDimSize.parse('100x150', 'x')
|
|
73
|
-
|
|
74
|
-
# Теперь присваиваем какому-либо объекту
|
|
75
|
-
some_object_width = two_dim.width
|
|
76
|
-
some_object_height = two_dim.height
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
### 🛠️ Поддерживаемые технологии:
|
|
80
|
-
|
|
81
|
-
- `Python` версии 3.
|
|
82
|
-
- Совместима с большинством популярных веб-фреймворков и библиотек Python
|
|
83
|
-
- Оптимизирован для работы с большими объемами данных и высоконагруженными приложениями
|
|
84
|
-
|
|
85
|
-
### 💬 Вопросы и поддержка:
|
|
86
|
-
|
|
87
|
-
Для подробной справки обратитесь к руководству по библиотеке в разделе документации:
|
|
88
|
-
|
|
89
|
-
🔗 Справочное руководство → [Документация библиотеки](https://gitflic.ru/project/babaev-an/anb-python-components/wiki)
|
|
90
|
-
|
|
91
|
-
---
|
|
92
|
-
|
|
93
|
-
# 📌🇬🇧 English Version
|
|
94
|
-
|
|
95
|
-
---
|
|
96
|
-
|
|
97
|
-
## Python Component Collection for Streamlining Application Development
|
|
98
|
-
|
|
99
|
-
**ANB Python Components** is a collection of useful classes and modules specifically tailored to accelerate the process
|
|
100
|
-
of developing software using the Python programming language. It offers a broad spectrum of tools that simplify everyday
|
|
101
|
-
developer tasks, from file manipulation and network requests to test automation and seamless integration with widely
|
|
102
|
-
used frameworks.
|
|
103
|
-
|
|
104
|
-
### ✅ Main Features:
|
|
105
|
-
|
|
106
|
-
- Handy tools for working with files and directories.
|
|
107
|
-
- Classes for handling files and folders.
|
|
108
|
-
- Classes for convenient state transfer.
|
|
109
|
-
- New custom_types such
|
|
110
|
-
as [GUID](https://gitflic.ru/project/babaev-an/anb-python-components/wiki/page?file=class_desc%2Fcustom_types%2Fguid.md),
|
|
111
|
-
[TwoDimSize](https://gitflic.ru/project/babaev-an/anb-python-components/wiki/page?file=class_desc%2Fcustom_types%2Ftwo_dim_size.md), [VersionInfo](https://gitflic.ru/project/babaev-an/anb-python-components/wiki/page?file=class_desc%2Fcustom_types%2Fversion_info.md), [ShortCodeAttributes](https://gitflic.ru/project/babaev-an/anb-python-components/wiki/page?file=class_desc%2Fcustom_types%2Fshortcode_attributes.md)
|
|
112
|
-
and [ObjectArray](https://gitflic.ru/project/babaev-an/anb-python-components/wiki/page?file=class_desc%2Fcustom_types%2Fobject_array.md).
|
|
113
|
-
- Extensions for arrays, `bool`, `GUID`, and `str` custom_types.
|
|
114
|
-
- Class for converting any type into string representation and vice versa.
|
|
115
|
-
|
|
116
|
-
### ⚙️ Installation and Usage:
|
|
117
|
-
|
|
118
|
-
You can install this package via pip:
|
|
119
|
-
|
|
120
|
-
```bash
|
|
121
|
-
pip install anb-python-components
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
Import required modules and start using them immediately:
|
|
125
|
-
|
|
126
|
-
```python
|
|
127
|
-
from anb_python_components import TwoDimSize
|
|
128
|
-
|
|
129
|
-
# Example usage
|
|
130
|
-
two_dim = TwoDimSize.parse('100x150', 'x')
|
|
131
|
-
|
|
132
|
-
# Now assign it to some object
|
|
133
|
-
some_object_width = two_dim.width
|
|
134
|
-
some_object_height = two_dim.height
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
### 🛠️ Supported Technologies:
|
|
138
|
-
|
|
139
|
-
- **Python**: version 3.
|
|
140
|
-
- Compatibility with most popular Python web frameworks and libraries
|
|
141
|
-
- Optimized for performance with large-scale datasets and highly loaded applications
|
|
142
|
-
|
|
143
|
-
### 💬 Questions and Support:
|
|
144
|
-
|
|
145
|
-
For comprehensive guidance and support, consult the library's documentation section:
|
|
146
|
-
|
|
147
|
-
🔗 Reference Guide → [Library Documentation](https://gitflic.ru/project/babaev-an/anb-python-components/wiki) (in Russian
|
|
148
|
-
Only)
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: anb_python_components
|
|
3
|
+
Version: 1.5.0
|
|
4
|
+
Summary: Набор компонентов Python, которые упрощают разработку / A set of Python components that simplify development
|
|
5
|
+
Home-page: https://gitflic.ru/project/babaev-an/anb-python-components
|
|
6
|
+
Author: Александр Бабаев
|
|
7
|
+
Author-email: contact_with_us@babaev-an.ru
|
|
8
|
+
Project-URL: Documentation, https://gitflic.ru/project/babaev-an/anb-python-components/wiki
|
|
9
|
+
Project-URL: Source, https://gitflic.ru/project/babaev-an/anb-python-components
|
|
10
|
+
Project-URL: Tracker, https://gitflic.ru/project/babaev-an/anb-python-components/issue?page=0
|
|
11
|
+
Keywords: python components development utils
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
18
|
+
Requires-Python: >=3.10.6
|
|
19
|
+
Description-Content-Type: text/markdown
|
|
20
|
+
License-File: LICENSE
|
|
21
|
+
Requires-Dist: setuptools>=80.9.0
|
|
22
|
+
Dynamic: author
|
|
23
|
+
Dynamic: author-email
|
|
24
|
+
Dynamic: classifier
|
|
25
|
+
Dynamic: description
|
|
26
|
+
Dynamic: description-content-type
|
|
27
|
+
Dynamic: home-page
|
|
28
|
+
Dynamic: keywords
|
|
29
|
+
Dynamic: license-file
|
|
30
|
+
Dynamic: project-url
|
|
31
|
+
Dynamic: requires-dist
|
|
32
|
+
Dynamic: requires-python
|
|
33
|
+
Dynamic: summary
|
|
34
|
+
|
|
35
|
+
# 📌🇷🇺 Русская версия
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Набор компонентов Python для упрощения разработки приложений
|
|
40
|
+
|
|
41
|
+
**ANB Python Components** — это библиотека полезных классов и модулей, предназначенная для ускорения процесса разработки
|
|
42
|
+
программного обеспечения на языке программирования Python. Библиотека включает широкий спектр инструментов, облегчающих
|
|
43
|
+
выполнение повседневных задач разработчика, от обработки файлов и сетевых запросов до автоматизации тестирования и
|
|
44
|
+
интеграции с популярными фреймворками.
|
|
45
|
+
|
|
46
|
+
### ✅ Основные возможности:
|
|
47
|
+
|
|
48
|
+
- Удобные инструменты для работы с файлами и каталогами.
|
|
49
|
+
- Классы для работы с файлами и директориями.
|
|
50
|
+
- Классы для удобной передачи состояния.
|
|
51
|
+
- Новые
|
|
52
|
+
типы [GUID](https://gitflic.ru/project/babaev-an/anb-python-components/wiki/page?file=class_desc%2Fcustom_types%2Fguid.md),
|
|
53
|
+
[TwoDimSize](https://gitflic.ru/project/babaev-an/anb-python-components/wiki/page?file=class_desc%2Fcustom_types%2Ftwo_dim_size.md), [VersionInfo](https://gitflic.ru/project/babaev-an/anb-python-components/wiki/page?file=class_desc%2Fcustom_types%2Fversion_info.md), [ShortCodeAttributes](https://gitflic.ru/project/babaev-an/anb-python-components/wiki/page?file=class_desc%2Fcustom_types%2Fshortcode_attributes.md)
|
|
54
|
+
и [ObjectArray](https://gitflic.ru/project/babaev-an/anb-python-components/wiki/page?file=class_desc%2Fcustom_types%2Fobject_array.md).
|
|
55
|
+
- Расширение массивов, типа `bool`, типа `GUID`, типа `str`.
|
|
56
|
+
- Класс для перевода любого типа в строку и наоборот.
|
|
57
|
+
|
|
58
|
+
### ⚙️ Установка и использование:
|
|
59
|
+
|
|
60
|
+
Установить пакет можно через pip:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
pip install anb-python-components
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Подключайте необходимые модули и начните пользоваться ими прямо сейчас:
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
from anb_python_components import TwoDimSize
|
|
70
|
+
|
|
71
|
+
# Пример использования
|
|
72
|
+
two_dim = TwoDimSize.parse('100x150', 'x')
|
|
73
|
+
|
|
74
|
+
# Теперь присваиваем какому-либо объекту
|
|
75
|
+
some_object_width = two_dim.width
|
|
76
|
+
some_object_height = two_dim.height
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### 🛠️ Поддерживаемые технологии:
|
|
80
|
+
|
|
81
|
+
- `Python` версии 3.10.6 и выше
|
|
82
|
+
- Совместима с большинством популярных веб-фреймворков и библиотек Python
|
|
83
|
+
- Оптимизирован для работы с большими объемами данных и высоконагруженными приложениями
|
|
84
|
+
|
|
85
|
+
### 💬 Вопросы и поддержка:
|
|
86
|
+
|
|
87
|
+
Для подробной справки обратитесь к руководству по библиотеке в разделе документации:
|
|
88
|
+
|
|
89
|
+
🔗 Справочное руководство → [Документация библиотеки](https://gitflic.ru/project/babaev-an/anb-python-components/wiki)
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
# 📌🇬🇧 English Version
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Python Component Collection for Streamlining Application Development
|
|
98
|
+
|
|
99
|
+
**ANB Python Components** is a collection of useful classes and modules specifically tailored to accelerate the process
|
|
100
|
+
of developing software using the Python programming language. It offers a broad spectrum of tools that simplify everyday
|
|
101
|
+
developer tasks, from file manipulation and network requests to test automation and seamless integration with widely
|
|
102
|
+
used frameworks.
|
|
103
|
+
|
|
104
|
+
### ✅ Main Features:
|
|
105
|
+
|
|
106
|
+
- Handy tools for working with files and directories.
|
|
107
|
+
- Classes for handling files and folders.
|
|
108
|
+
- Classes for convenient state transfer.
|
|
109
|
+
- New custom_types such
|
|
110
|
+
as [GUID](https://gitflic.ru/project/babaev-an/anb-python-components/wiki/page?file=class_desc%2Fcustom_types%2Fguid.md),
|
|
111
|
+
[TwoDimSize](https://gitflic.ru/project/babaev-an/anb-python-components/wiki/page?file=class_desc%2Fcustom_types%2Ftwo_dim_size.md), [VersionInfo](https://gitflic.ru/project/babaev-an/anb-python-components/wiki/page?file=class_desc%2Fcustom_types%2Fversion_info.md), [ShortCodeAttributes](https://gitflic.ru/project/babaev-an/anb-python-components/wiki/page?file=class_desc%2Fcustom_types%2Fshortcode_attributes.md)
|
|
112
|
+
and [ObjectArray](https://gitflic.ru/project/babaev-an/anb-python-components/wiki/page?file=class_desc%2Fcustom_types%2Fobject_array.md).
|
|
113
|
+
- Extensions for arrays, `bool`, `GUID`, and `str` custom_types.
|
|
114
|
+
- Class for converting any type into string representation and vice versa.
|
|
115
|
+
|
|
116
|
+
### ⚙️ Installation and Usage:
|
|
117
|
+
|
|
118
|
+
You can install this package via pip:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
pip install anb-python-components
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Import required modules and start using them immediately:
|
|
125
|
+
|
|
126
|
+
```python
|
|
127
|
+
from anb_python_components import TwoDimSize
|
|
128
|
+
|
|
129
|
+
# Example usage
|
|
130
|
+
two_dim = TwoDimSize.parse('100x150', 'x')
|
|
131
|
+
|
|
132
|
+
# Now assign it to some object
|
|
133
|
+
some_object_width = two_dim.width
|
|
134
|
+
some_object_height = two_dim.height
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### 🛠️ Supported Technologies:
|
|
138
|
+
|
|
139
|
+
- **Python**: version 3.10.6 or higher
|
|
140
|
+
- Compatibility with most popular Python web frameworks and libraries
|
|
141
|
+
- Optimized for performance with large-scale datasets and highly loaded applications
|
|
142
|
+
|
|
143
|
+
### 💬 Questions and Support:
|
|
144
|
+
|
|
145
|
+
For comprehensive guidance and support, consult the library's documentation section:
|
|
146
|
+
|
|
147
|
+
🔗 Reference Guide → [Library Documentation](https://gitflic.ru/project/babaev-an/anb-python-components/wiki) (in Russian
|
|
148
|
+
Only)
|
|
@@ -44,7 +44,7 @@ some_object_height = two_dim.height
|
|
|
44
44
|
|
|
45
45
|
### 🛠️ Поддерживаемые технологии:
|
|
46
46
|
|
|
47
|
-
- `Python` версии 3.
|
|
47
|
+
- `Python` версии 3.10.6 и выше
|
|
48
48
|
- Совместима с большинством популярных веб-фреймворков и библиотек Python
|
|
49
49
|
- Оптимизирован для работы с большими объемами данных и высоконагруженными приложениями
|
|
50
50
|
|
|
@@ -102,7 +102,7 @@ some_object_height = two_dim.height
|
|
|
102
102
|
|
|
103
103
|
### 🛠️ Supported Technologies:
|
|
104
104
|
|
|
105
|
-
- **Python**: version 3.
|
|
105
|
+
- **Python**: version 3.10.6 or higher
|
|
106
106
|
- Compatibility with most popular Python web frameworks and libraries
|
|
107
107
|
- Optimized for performance with large-scale datasets and highly loaded applications
|
|
108
108
|
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# anb_python_components/__init__.py
|
|
2
|
+
|
|
3
|
+
# classes
|
|
4
|
+
from anb_python_components.classes import (
|
|
5
|
+
ActionState, DataclassAnalyzer, Directory, File, Interface, ShortCodeParser, Logger
|
|
6
|
+
)
|
|
7
|
+
# custom_types
|
|
8
|
+
from anb_python_components.custom_types import GUID, ObjectArray, ShortCodeAttributes, TwoDimSize, VersionInfo
|
|
9
|
+
# decorators
|
|
10
|
+
from anb_python_components.decorators import implement, interface_required
|
|
11
|
+
# enums
|
|
12
|
+
from anb_python_components.enums import MessageType, NotBoolAction, TypeCopyStrategy
|
|
13
|
+
# exceptions
|
|
14
|
+
from anb_python_components.exceptions import WrongTypeException
|
|
15
|
+
# extensions
|
|
16
|
+
from anb_python_components.extensions import (
|
|
17
|
+
ArrayExtension, BoolExtension, DataClassExtension, StringExtension, TypeExtension
|
|
18
|
+
)
|
|
19
|
+
# log_formatters
|
|
20
|
+
from anb_python_components.log_formatters import DefaultLogFormatter, RussianLogFormatter
|
|
21
|
+
# log_handlers
|
|
22
|
+
from anb_python_components.log_handlers import (
|
|
23
|
+
ConsoleHandler, FileHandler, RotatingFileHandler, BufferedFileHandler, BufferedRotatingFileHandler
|
|
24
|
+
)
|
|
25
|
+
# models
|
|
26
|
+
from anb_python_components.models import ActionStateMessage, ShortCodeModel
|
|
27
|
+
# protocols
|
|
28
|
+
from anb_python_components.protocols import ILogFormatter, ILogHandler
|
|
29
|
+
|
|
30
|
+
__all__ = [
|
|
31
|
+
'ActionState',
|
|
32
|
+
'Directory',
|
|
33
|
+
'File',
|
|
34
|
+
'DataclassAnalyzer',
|
|
35
|
+
'Interface',
|
|
36
|
+
'ShortCodeParser',
|
|
37
|
+
'Logger',
|
|
38
|
+
'GUID',
|
|
39
|
+
'ObjectArray',
|
|
40
|
+
'ShortCodeAttributes',
|
|
41
|
+
'TwoDimSize',
|
|
42
|
+
'VersionInfo',
|
|
43
|
+
'interface_required',
|
|
44
|
+
'implement',
|
|
45
|
+
'MessageType',
|
|
46
|
+
'NotBoolAction',
|
|
47
|
+
'TypeCopyStrategy',
|
|
48
|
+
'WrongTypeException',
|
|
49
|
+
'ArrayExtension',
|
|
50
|
+
'BoolExtension',
|
|
51
|
+
'StringExtension',
|
|
52
|
+
'TypeExtension',
|
|
53
|
+
'DataClassExtension',
|
|
54
|
+
'DefaultLogFormatter',
|
|
55
|
+
'RussianLogFormatter',
|
|
56
|
+
'ConsoleHandler',
|
|
57
|
+
'FileHandler',
|
|
58
|
+
'RotatingFileHandler',
|
|
59
|
+
'BufferedFileHandler',
|
|
60
|
+
'BufferedRotatingFileHandler',
|
|
61
|
+
'ActionStateMessage',
|
|
62
|
+
'ShortCodeModel',
|
|
63
|
+
'ILogFormatter',
|
|
64
|
+
'ILogHandler'
|
|
65
|
+
]
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
# anb_python_components/classes/__init__.py
|
|
2
|
-
|
|
3
|
-
from anb_python_components.classes.action_state import ActionState
|
|
4
|
-
from anb_python_components.classes.dataclass_analyzer import DataclassAnalyzer
|
|
5
|
-
from anb_python_components.classes.directory import Directory
|
|
6
|
-
from anb_python_components.classes.file import File
|
|
7
|
-
from anb_python_components.classes.interface import Interface
|
|
1
|
+
# anb_python_components/classes/__init__.py
|
|
2
|
+
|
|
3
|
+
from anb_python_components.classes.action_state import ActionState
|
|
4
|
+
from anb_python_components.classes.dataclass_analyzer import DataclassAnalyzer
|
|
5
|
+
from anb_python_components.classes.directory import Directory
|
|
6
|
+
from anb_python_components.classes.file import File
|
|
7
|
+
from anb_python_components.classes.interface import Interface
|
|
8
|
+
from anb_python_components.classes.logger import Logger
|
|
8
9
|
from anb_python_components.classes.shortcode_parser import ShortCodeParser
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
# anb_python_components/classes/action_state.py
|
|
2
2
|
import copy
|
|
3
|
-
from typing import Callable
|
|
3
|
+
from typing import Any, Callable
|
|
4
4
|
|
|
5
5
|
from anb_python_components.enums.message_type import MessageType
|
|
6
6
|
from anb_python_components.exceptions.wrong_type_exception import WrongTypeException
|
|
7
7
|
from anb_python_components.models.action_state_message import ActionStateMessage
|
|
8
8
|
|
|
9
9
|
# noinspection Annotator
|
|
10
|
-
class ActionState
|
|
10
|
+
class ActionState:
|
|
11
11
|
"""
|
|
12
12
|
Класс для хранения состояния действия.
|
|
13
13
|
"""
|
|
14
14
|
|
|
15
|
-
def __init__ (self, default:
|
|
15
|
+
def __init__ (self, default: Any = None):
|
|
16
|
+
"""
|
|
17
|
+
Инициализация.
|
|
18
|
+
:param default: Значение по-умолчанию.
|
|
19
|
+
"""
|
|
16
20
|
self.__messages: list[ActionStateMessage] = []
|
|
17
|
-
self.value:
|
|
21
|
+
self.value: Any = copy.deepcopy(default) if default is not None else None
|
|
18
22
|
|
|
19
23
|
@staticmethod
|
|
20
24
|
def get_string_error_only () -> Callable[[ActionStateMessage], bool]:
|
|
File without changes
|
|
@@ -18,7 +18,7 @@ class Directory:
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
@staticmethod
|
|
21
|
-
def remove (directory: str, error_messages: dict[str, str] | None = None) -> ActionState
|
|
21
|
+
def remove (directory: str, error_messages: dict[str, str] | None = None) -> ActionState:
|
|
22
22
|
"""
|
|
23
23
|
Рекурсивно удаляет директорию с соответствующим результатом.
|
|
24
24
|
|
|
@@ -27,7 +27,7 @@ class Directory:
|
|
|
27
27
|
:return: Объект ActionState с информацией о результате.
|
|
28
28
|
"""
|
|
29
29
|
# Создаем объект ActionState для хранения результата
|
|
30
|
-
result = ActionState
|
|
30
|
+
result = ActionState(False)
|
|
31
31
|
|
|
32
32
|
# Если не заданы сообщения об ошибках
|
|
33
33
|
if error_messages is None:
|