bear-utils 0.7.20__tar.gz → 0.7.23__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 (122) hide show
  1. {bear_utils-0.7.20 → bear_utils-0.7.23}/.bumpversion.cfg +1 -1
  2. {bear_utils-0.7.20 → bear_utils-0.7.23}/PKG-INFO +50 -7
  3. {bear_utils-0.7.20 → bear_utils-0.7.23}/README.md +48 -5
  4. bear_utils-0.7.23/config/coverage.ini +25 -0
  5. bear_utils-0.7.23/config/default.toml +17 -0
  6. bear_utils-0.7.23/config/git-changelog.toml +9 -0
  7. bear_utils-0.7.23/config/pytest.ini +14 -0
  8. bear_utils-0.7.23/config/ruff.toml +111 -0
  9. bear_utils-0.7.23/config/vscode/launch.json +57 -0
  10. bear_utils-0.7.23/config/vscode/settings.json +25 -0
  11. bear_utils-0.7.23/config/vscode/tasks.json +76 -0
  12. {bear_utils-0.7.20 → bear_utils-0.7.23}/directory_structure.txt +40 -38
  13. bear_utils-0.7.23/noxfile.py +70 -0
  14. {bear_utils-0.7.20 → bear_utils-0.7.23}/pyproject.toml +19 -2
  15. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/__init__.py +24 -1
  16. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/ai/__init__.py +5 -5
  17. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/ai/ai_helpers/__init__.py +24 -18
  18. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/ai/ai_helpers/_parsers.py +27 -21
  19. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/ai/ai_helpers/_types.py +2 -7
  20. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/cache/__init__.py +35 -23
  21. bear_utils-0.7.23/src/bear_utils/cli/__init__.py +17 -0
  22. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/cli/commands.py +14 -8
  23. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/cli/prompt_helpers.py +40 -34
  24. bear_utils-0.7.23/src/bear_utils/cli/shell/__init__.py +1 -0
  25. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/cli/shell/_base_command.py +18 -18
  26. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/cli/shell/_base_shell.py +37 -34
  27. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/config/__init__.py +4 -2
  28. bear_utils-0.7.23/src/bear_utils/config/config_manager.py +229 -0
  29. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/config/dir_manager.py +8 -3
  30. bear_utils-0.7.23/src/bear_utils/config/settings_manager.py +155 -0
  31. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/constants/__init__.py +2 -1
  32. bear_utils-0.7.23/src/bear_utils/constants/_exceptions.py +8 -0
  33. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/constants/date_related.py +2 -0
  34. bear_utils-0.7.23/src/bear_utils/constants/logger_protocol.py +28 -0
  35. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/constants/time_related.py +2 -0
  36. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/database/__init__.py +2 -0
  37. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/database/_db_manager.py +10 -11
  38. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/events/__init__.py +3 -1
  39. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/events/events_class.py +11 -11
  40. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/events/events_module.py +17 -8
  41. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/extras/__init__.py +8 -6
  42. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/extras/_async_helpers.py +2 -3
  43. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/extras/_tools.py +62 -52
  44. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/extras/platform_utils.py +5 -1
  45. bear_utils-0.7.23/src/bear_utils/extras/responses/__init__.py +1 -0
  46. bear_utils-0.7.23/src/bear_utils/extras/responses/function_response.py +301 -0
  47. bear_utils-0.7.23/src/bear_utils/extras/wrappers/__init__.py +1 -0
  48. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/extras/wrappers/add_methods.py +17 -15
  49. bear_utils-0.7.23/src/bear_utils/files/__init__.py +6 -0
  50. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/files/file_handlers/__init__.py +2 -0
  51. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/files/file_handlers/_base_file_handler.py +23 -3
  52. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/files/file_handlers/file_handler_factory.py +38 -38
  53. bear_utils-0.7.23/src/bear_utils/files/file_handlers/json_file_handler.py +71 -0
  54. bear_utils-0.7.23/src/bear_utils/files/file_handlers/log_file_handler.py +40 -0
  55. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/files/file_handlers/toml_file_handler.py +13 -5
  56. bear_utils-0.7.23/src/bear_utils/files/file_handlers/txt_file_handler.py +76 -0
  57. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/files/file_handlers/yaml_file_handler.py +19 -13
  58. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/files/ignore_parser.py +52 -57
  59. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/graphics/__init__.py +3 -1
  60. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/graphics/bear_gradient.py +17 -12
  61. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/graphics/image_helpers.py +11 -5
  62. bear_utils-0.7.23/src/bear_utils/gui/__init__.py +8 -0
  63. bear_utils-0.7.23/src/bear_utils/gui/gui_tools/__init__.py +10 -0
  64. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/gui/gui_tools/_settings.py +0 -1
  65. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/gui/gui_tools/qt_app.py +16 -11
  66. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/gui/gui_tools/qt_color_picker.py +24 -13
  67. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/gui/gui_tools/qt_file_handler.py +30 -38
  68. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/gui/gui_tools/qt_input_dialog.py +11 -14
  69. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/logging/__init__.py +6 -4
  70. bear_utils-0.7.23/src/bear_utils/logging/logger_manager/__init__.py +1 -0
  71. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/logging/logger_manager/_common.py +0 -1
  72. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/logging/logger_manager/_console_junk.py +14 -10
  73. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/logging/logger_manager/_styles.py +1 -2
  74. bear_utils-0.7.23/src/bear_utils/logging/logger_manager/loggers/__init__.py +1 -0
  75. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/logging/logger_manager/loggers/_base_logger.py +33 -36
  76. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/logging/logger_manager/loggers/_base_logger.pyi +6 -5
  77. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/logging/logger_manager/loggers/_buffer_logger.py +2 -3
  78. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/logging/logger_manager/loggers/_console_logger.py +52 -26
  79. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/logging/logger_manager/loggers/_console_logger.pyi +7 -21
  80. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/logging/logger_manager/loggers/_file_logger.py +20 -13
  81. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/logging/logger_manager/loggers/_level_sin.py +15 -15
  82. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/logging/logger_manager/loggers/_logger.py +4 -6
  83. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/logging/logger_manager/loggers/_sub_logger.py +16 -23
  84. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/logging/logger_manager/loggers/_sub_logger.pyi +4 -19
  85. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/logging/loggers.py +9 -13
  86. bear_utils-0.7.23/src/bear_utils/monitoring/__init__.py +13 -0
  87. bear_utils-0.7.23/src/bear_utils/monitoring/_common.py +28 -0
  88. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/monitoring/host_monitor.py +44 -48
  89. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/time/__init__.py +13 -6
  90. bear_utils-0.7.23/tests/test_clipboard.py +48 -0
  91. {bear_utils-0.7.20 → bear_utils-0.7.23}/tests/test_default_shell.py +1 -1
  92. {bear_utils-0.7.20 → bear_utils-0.7.23}/tests/test_gradient.py +4 -6
  93. {bear_utils-0.7.20 → bear_utils-0.7.23}/tests/test_logger.py +8 -10
  94. {bear_utils-0.7.20 → bear_utils-0.7.23}/uv.lock +118 -3
  95. bear_utils-0.7.20/src/bear_utils/cli/__init__.py +0 -4
  96. bear_utils-0.7.20/src/bear_utils/config/config_manager.py +0 -92
  97. bear_utils-0.7.20/src/bear_utils/config/settings_manager.py +0 -232
  98. bear_utils-0.7.20/src/bear_utils/constants/_exceptions.py +0 -3
  99. bear_utils-0.7.20/src/bear_utils/extras/wrappers/__init__.py +0 -0
  100. bear_utils-0.7.20/src/bear_utils/files/__init__.py +0 -4
  101. bear_utils-0.7.20/src/bear_utils/files/file_handlers/json_file_handler.py +0 -44
  102. bear_utils-0.7.20/src/bear_utils/files/file_handlers/log_file_handler.py +0 -33
  103. bear_utils-0.7.20/src/bear_utils/files/file_handlers/txt_file_handler.py +0 -34
  104. bear_utils-0.7.20/src/bear_utils/gui/__init__.py +0 -3
  105. bear_utils-0.7.20/src/bear_utils/gui/gui_tools/__init__.py +0 -5
  106. bear_utils-0.7.20/src/bear_utils/logging/logger_manager/__init__.py +0 -0
  107. bear_utils-0.7.20/src/bear_utils/logging/logger_manager/loggers/__init__.py +0 -0
  108. bear_utils-0.7.20/src/bear_utils/monitoring/__init__.py +0 -10
  109. bear_utils-0.7.20/tests/__init__.py +0 -0
  110. bear_utils-0.7.20/tests/test_clipboard.py +0 -50
  111. {bear_utils-0.7.20 → bear_utils-0.7.23}/.gitignore +0 -0
  112. {bear_utils-0.7.20 → bear_utils-0.7.23}/.python-version +0 -0
  113. {bear_utils-0.7.20 → bear_utils-0.7.23}/AGENTS.md +0 -0
  114. {bear_utils-0.7.20 → bear_utils-0.7.23}/maskfile.md +0 -0
  115. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/ai/ai_helpers/_common.py +0 -0
  116. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/ai/ai_helpers/_config.py +0 -0
  117. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/cli/shell/_common.py +0 -0
  118. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/constants/_lazy_typing.py +0 -0
  119. {bear_utils-0.7.20 → bear_utils-0.7.23}/src/bear_utils/gui/gui_tools/_types.py +0 -0
  120. {bear_utils-0.7.20/src/bear_utils/cli/shell → bear_utils-0.7.23/tests}/__init__.py +0 -0
  121. {bear_utils-0.7.20 → bear_utils-0.7.23}/tests/test_add_ord_suffix.py +0 -0
  122. {bear_utils-0.7.20 → bear_utils-0.7.23}/tests/test_platform_utils.py +0 -0
@@ -1,5 +1,5 @@
1
1
  [bumpversion]
2
- current_version = 0.7.20
2
+ current_version = 0.7.23
3
3
 
4
4
  [bumpversion:file:pyproject.toml]
5
5
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: bear-utils
3
- Version: 0.7.20
3
+ Version: 0.7.23
4
4
  Summary: Various utilities for Bear programmers, including a rich logging utility, a disk cache, and a SQLite database wrapper amongst other things.
5
5
  Author-email: chaz <bright.lid5647@fastmail.com>
6
6
  Requires-Python: >=3.12
@@ -12,15 +12,15 @@ Requires-Dist: pillow<12.0.0,>=11.2.1
12
12
  Requires-Dist: prompt-toolkit<4.0.0,>=3.0.51
13
13
  Requires-Dist: pydantic>=2.11.5
14
14
  Requires-Dist: pyglm<3.0.0,>=2.8.2
15
- Requires-Dist: pyqt6>=6.9.0
16
15
  Requires-Dist: pyyaml>=6.0.2
17
16
  Requires-Dist: rich<15.0.0,>=14.0.0
18
17
  Requires-Dist: singleton-base>=1.0.5
19
18
  Requires-Dist: sqlalchemy<3.0.0,>=2.0.40
19
+ Requires-Dist: tinydb>=4.8.2
20
20
  Requires-Dist: toml>=0.10.2
21
21
  Description-Content-Type: text/markdown
22
22
 
23
- # Bear Utils v# Bear Utils v0.7.20
23
+ # Bear Utils v# Bear Utils v0.7.23
24
24
 
25
25
  Personal set of tools and utilities for Python projects, focusing on modularity and ease of use. This library includes components for caching, database management, logging, time handling, file operations, CLI prompts, image processing, clipboard interaction, gradient utilities, event systems, and async helpers.
26
26
 
@@ -31,11 +31,12 @@ Bear Utils is a collection of utility modules I've created for common tasks acro
31
31
  ## Installation
32
32
 
33
33
  ```bash
34
- # Using pip
35
- pip install bear-utils
34
+ pip install bear-util. # Core package (recommended for most users)
35
+ pip install bear-utils[gui] # With optional GUI functionality
36
36
 
37
- # Using poetry
38
- poetry add bear-utils
37
+ # Using UV
38
+ uv add bear-utils # Core only
39
+ uv add bear-utils --group gui # With GUI functionality
39
40
  ```
40
41
 
41
42
  ## Key Components
@@ -138,6 +139,48 @@ choice = restricted_prompt(
138
139
  )
139
140
  ```
140
141
 
142
+ ### GUI Utilities (Optional)
143
+
144
+ **Note: GUI functionality requires the optional PyQt6 dependency. Install with `pip install bear-utils[gui]`**
145
+
146
+ The `gui` package provides PyQt6-based dialog utilities for desktop applications:
147
+
148
+ ```python
149
+ # Color picker dialog
150
+ from bear_utils.gui import select_color
151
+
152
+ color_info = select_color(
153
+ initial_color="#FF5733",
154
+ title="Choose a Color"
155
+ )
156
+ if color_info:
157
+ print(f"Selected: {color_info.hex}") # e.g., "#FF5733"
158
+ print(f"RGB: {color_info.rgb}") # ColorTriplet(255, 87, 51)
159
+ print(f"RGBA: {color_info.rgba}") # (255, 87, 51, 255)
160
+
161
+ # Text input dialog
162
+ from bear_utils.gui import get_text
163
+
164
+ user_input = get_text(
165
+ title="Input Required",
166
+ label="Enter your name:",
167
+ default="Default text"
168
+ )
169
+
170
+ # Qt Application wrapper
171
+ from bear_utils.gui import QTApplication
172
+
173
+ app = QTApplication(
174
+ app_name="My App",
175
+ org_name="My Organization"
176
+ )
177
+ ```
178
+
179
+ **Error handling**: If PyQt6 is not installed, importing GUI components will raise a helpful error:
180
+ ```
181
+ ImportError: PyQt6 is required for GUI functionality. Install it with: pip install bear-utils[gui]
182
+ ```
183
+
141
184
  ### Image Helpers
142
185
 
143
186
  Utilities for working with images are located in the `graphics` package:
@@ -1,4 +1,4 @@
1
- # Bear Utils v# Bear Utils v0.7.20
1
+ # Bear Utils v# Bear Utils v0.7.23
2
2
 
3
3
  Personal set of tools and utilities for Python projects, focusing on modularity and ease of use. This library includes components for caching, database management, logging, time handling, file operations, CLI prompts, image processing, clipboard interaction, gradient utilities, event systems, and async helpers.
4
4
 
@@ -9,11 +9,12 @@ Bear Utils is a collection of utility modules I've created for common tasks acro
9
9
  ## Installation
10
10
 
11
11
  ```bash
12
- # Using pip
13
- pip install bear-utils
12
+ pip install bear-util. # Core package (recommended for most users)
13
+ pip install bear-utils[gui] # With optional GUI functionality
14
14
 
15
- # Using poetry
16
- poetry add bear-utils
15
+ # Using UV
16
+ uv add bear-utils # Core only
17
+ uv add bear-utils --group gui # With GUI functionality
17
18
  ```
18
19
 
19
20
  ## Key Components
@@ -116,6 +117,48 @@ choice = restricted_prompt(
116
117
  )
117
118
  ```
118
119
 
120
+ ### GUI Utilities (Optional)
121
+
122
+ **Note: GUI functionality requires the optional PyQt6 dependency. Install with `pip install bear-utils[gui]`**
123
+
124
+ The `gui` package provides PyQt6-based dialog utilities for desktop applications:
125
+
126
+ ```python
127
+ # Color picker dialog
128
+ from bear_utils.gui import select_color
129
+
130
+ color_info = select_color(
131
+ initial_color="#FF5733",
132
+ title="Choose a Color"
133
+ )
134
+ if color_info:
135
+ print(f"Selected: {color_info.hex}") # e.g., "#FF5733"
136
+ print(f"RGB: {color_info.rgb}") # ColorTriplet(255, 87, 51)
137
+ print(f"RGBA: {color_info.rgba}") # (255, 87, 51, 255)
138
+
139
+ # Text input dialog
140
+ from bear_utils.gui import get_text
141
+
142
+ user_input = get_text(
143
+ title="Input Required",
144
+ label="Enter your name:",
145
+ default="Default text"
146
+ )
147
+
148
+ # Qt Application wrapper
149
+ from bear_utils.gui import QTApplication
150
+
151
+ app = QTApplication(
152
+ app_name="My App",
153
+ org_name="My Organization"
154
+ )
155
+ ```
156
+
157
+ **Error handling**: If PyQt6 is not installed, importing GUI components will raise a helpful error:
158
+ ```
159
+ ImportError: PyQt6 is required for GUI functionality. Install it with: pip install bear-utils[gui]
160
+ ```
161
+
119
162
  ### Image Helpers
120
163
 
121
164
  Utilities for working with images are located in the `graphics` package:
@@ -0,0 +1,25 @@
1
+ [coverage:run]
2
+ branch = true
3
+ parallel = true
4
+ source =
5
+ src/
6
+ tests/
7
+
8
+ [coverage:paths]
9
+ equivalent =
10
+ src/
11
+ .venv/lib/*/site-packages/
12
+ .venvs/*/lib/*/site-packages/
13
+
14
+ [coverage:report]
15
+ precision = 2
16
+ omit =
17
+ src/*/__init__.py
18
+ src/*/__main__.py
19
+ tests/__init__.py
20
+ exclude_lines =
21
+ pragma: no cover
22
+ if TYPE_CHECKING
23
+
24
+ [coverage:json]
25
+ output = htmlcov/coverage.json
@@ -0,0 +1,17 @@
1
+ # Default configuration
2
+
3
+ [database]
4
+ host = "localhost"
5
+ port = 5432
6
+ username = "app"
7
+ password = "secret"
8
+ database = "myapp"
9
+
10
+ [logging]
11
+ level = "INFO"
12
+ format = "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
13
+ file = "null"
14
+ environment = "development"
15
+ debug = false
16
+ api_key = "your-api-key-here"
17
+ allowed_hosts = ["localhost", "127.0.0.1"]
@@ -0,0 +1,9 @@
1
+ bump = "auto"
2
+ convention = "angular"
3
+ in-place = true
4
+ output = "CHANGELOG.md"
5
+ parse-refs = false
6
+ parse-trailers = true
7
+ sections = ["build", "deps", "feat", "fix", "refactor"]
8
+ template = "keepachangelog"
9
+ versioning = "pep440"
@@ -0,0 +1,14 @@
1
+ [pytest]
2
+ python_files =
3
+ test_*.py
4
+ addopts =
5
+ --cov
6
+ --cov-config config/coverage.ini
7
+ testpaths =
8
+ tests
9
+
10
+ # action:message_regex:warning_class:module_regex:line
11
+ filterwarnings =
12
+ error
13
+ # TODO: remove once pytest-xdist 4 is released
14
+ ignore:.*rsyncdir:DeprecationWarning:xdist
@@ -0,0 +1,111 @@
1
+ target-version = "py313"
2
+ line-length = 120
3
+
4
+ [lint]
5
+ exclude = [
6
+ "tests/*.py",
7
+ ]
8
+ select = [
9
+ "A", "ANN", "ARG",
10
+ "B", "BLE",
11
+ "C", "C4",
12
+ "COM",
13
+ "D", "DTZ",
14
+ "E", "ERA", "EXE",
15
+ "F", "FBT",
16
+ "G",
17
+ "I", "ICN", "INP", "ISC",
18
+ "N",
19
+ "PGH", "PIE", "PL", "PLC", "PLE", "PLR", "PLW", "PT", "PYI",
20
+ "Q",
21
+ "RUF", "RSE", "RET",
22
+ "S", "SIM", "SLF",
23
+ "T", "T10", "T20", "TCH", "TID", "TRY",
24
+ "UP",
25
+ "W",
26
+ "YTT",
27
+ ]
28
+ ignore = [
29
+ "A001", # Variable is shadowing a Python builtin
30
+ "ANN201", # Missing return type annotation for public function (-> None is obvious)
31
+ "ANN204", # Missing return type annotation for special method __str__
32
+ "ANN401", # Dynamically typed expressions (typing.Any) are disallowed
33
+ "ARG005", # Unused lambda argument
34
+ "C901", # Too complex
35
+ "COM812", # Trailing comma missing (conflicts with formatter)
36
+ "D105", # Missing docstring in magic method
37
+ "D417", # Missing argument description in the docstring
38
+ "E501", # Line too long
39
+ "ERA001", # Commented out code
40
+ "G004", # Logging statement uses f-string
41
+ "PLR0911", # Too many return statements
42
+ "PLR0912", # Too many branches
43
+ "PLR0913", # Too many arguments to function call
44
+ "PLR0915", # Too many statements
45
+ "SLF001", # Private member accessed
46
+ "TRY003", # Avoid specifying long messages outside the exception class
47
+ "W291", # Trailing whitespace on blank line
48
+ "W293", # Blank line contains whitespace,
49
+ "ANN002", # Missing type annotation for *args
50
+ "ANN003", # Missing type annotation for **kwargs
51
+ "TRY400", # Use `logging.exception` instead of `logging.error`
52
+ "T201", # Print statement
53
+ "D415", # First line should end with a period, question mark, or exclamation point
54
+ "FBT001", # Boolean positional arg in function definition
55
+ "FBT002", # Boolean positional arg in function call
56
+ "BLE001", # Use of bare except
57
+ "TRY300", # Consider moving this statement to an `else` block
58
+ ]
59
+
60
+ [lint.per-file-ignores]
61
+ "src/**/cli.py" = [
62
+ "T201", # Print statement
63
+ ]
64
+ "src/*/debug.py" = [
65
+ "T201", # Print statement
66
+ ]
67
+ "!src/*/*.py" = [
68
+ "D100", # Missing docstring in public module
69
+ ]
70
+ "!src/**.py" = [
71
+ "D101", # Missing docstring in public class
72
+ "D103", # Missing docstring in public function
73
+ ]
74
+ "tests/**.py" = [
75
+ "ARG005", # Unused lambda argument
76
+ "FBT001", # Boolean positional arg in function definition
77
+ "PLR2004", # Magic value used in comparison
78
+ "S101", # Use of assert detected
79
+ "ANN001", # Missing type annotation for public function
80
+ "SIM115", # Use a context manager for opening files
81
+ "ARG001", # Unused argument
82
+ "F841", # Local variable is assigned to but never used
83
+ ]
84
+
85
+ [lint.flake8-quotes]
86
+ docstring-quotes = "double"
87
+
88
+ [lint.flake8-tidy-imports]
89
+ ban-relative-imports = "parents"
90
+
91
+ [lint.isort]
92
+ known-first-party = ["bear_utils"]
93
+ force-sort-within-sections = true
94
+ combine-as-imports = true
95
+ section-order = [
96
+ "future",
97
+ "standard-library",
98
+ "third-party",
99
+ "first-party",
100
+ "local-folder",
101
+ ]
102
+
103
+ [lint.pydocstyle]
104
+ convention = "google"
105
+
106
+ [format]
107
+ exclude = [
108
+ "tests/fixtures/*.py",
109
+ ]
110
+ docstring-code-format = true
111
+ docstring-code-line-length = 80
@@ -0,0 +1,57 @@
1
+ {
2
+ "version": "0.2.0",
3
+ "configurations": [
4
+ {
5
+ "name": "python (current file)",
6
+ "type": "debugpy",
7
+ "request": "launch",
8
+ "program": "${file}",
9
+ "console": "integratedTerminal",
10
+ "justMyCode": false,
11
+ "args": "${command:pickArgs}"
12
+ },
13
+ {
14
+ "name": "run",
15
+ "type": "debugpy",
16
+ "request": "launch",
17
+ "module": "trackdo",
18
+ "console": "integratedTerminal",
19
+ "justMyCode": false,
20
+ "args": "${command:pickArgs}"
21
+ },
22
+ {
23
+ "name": "docs",
24
+ "type": "debugpy",
25
+ "request": "launch",
26
+ "module": "mkdocs",
27
+ "justMyCode": false,
28
+ "args": [
29
+ "serve",
30
+ "-v"
31
+ ]
32
+ },
33
+ {
34
+ "name": "test",
35
+ "type": "debugpy",
36
+ "request": "launch",
37
+ "module": "pytest",
38
+ "justMyCode": false,
39
+ "args": [
40
+ "-c=config/pytest.ini",
41
+ "-vvv",
42
+ "--no-cov",
43
+ "--dist=no",
44
+ "tests",
45
+ "-k=${input:tests_selection}"
46
+ ]
47
+ }
48
+ ],
49
+ "inputs": [
50
+ {
51
+ "id": "tests_selection",
52
+ "type": "promptString",
53
+ "description": "Tests selection",
54
+ "default": ""
55
+ }
56
+ ]
57
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "files.watcherExclude": {
3
+ "**/.venv*/**": true,
4
+ "**/.venvs*/**": true,
5
+ "**/venv*/**": true,
6
+ },
7
+ "pyright.enable": true,
8
+ "python.testing.unittestEnabled": false,
9
+ "python.testing.pytestEnabled": true,
10
+ "python.testing.pytestArgs": ["--config-file=config/pytest.ini"],
11
+ "ruff.enable": true,
12
+ "ruff.format.args": ["--config=config/ruff.toml"],
13
+ "ruff.lint.args": ["--config=config/ruff.toml"],
14
+ "yaml.schemas": {
15
+ "https://squidfunk.github.io/mkdocs-material/schema.json": "mkdocs.yml"
16
+ },
17
+ "yaml.customTags": [
18
+ "!ENV scalar",
19
+ "!ENV sequence",
20
+ "!relative scalar",
21
+ "tag:yaml.org,2002:python/name:materialx.emoji.to_svg",
22
+ "tag:yaml.org,2002:python/name:materialx.emoji.twemoji",
23
+ "tag:yaml.org,2002:python/name:pymdownx.superfences.fence_code_format",
24
+ ],
25
+ }
@@ -0,0 +1,76 @@
1
+ {
2
+ "version": "2.0.0",
3
+ "tasks": [
4
+ {
5
+ "label": "clean",
6
+ "type": "shell",
7
+ "command": "mask",
8
+ "args": ["clean"],
9
+ "group": "build"
10
+ },
11
+ {
12
+ "label": "build",
13
+ "type": "shell",
14
+ "command": "mask",
15
+ "args": ["build"],
16
+ "group": "build"
17
+ },
18
+ {
19
+ "label": "test",
20
+ "type": "shell",
21
+ "command": "mask",
22
+ "args": ["test"],
23
+ "group": "test"
24
+ },
25
+ {
26
+ "label": "lint (ruff check)",
27
+ "type": "shell",
28
+ "command": "nox",
29
+ "args": ["-s", "ruff_check"],
30
+ "group": "build"
31
+ },
32
+ {
33
+ "label": "lint (ruff fix)",
34
+ "type": "shell",
35
+ "command": "nox",
36
+ "args": ["-s", "ruff_fix"],
37
+ "group": "build"
38
+ },
39
+ {
40
+ "label": "typecheck (pyright)",
41
+ "type": "shell",
42
+ "command": "nox",
43
+ "args": ["-s", "pyright"],
44
+ "group": "build"
45
+ },
46
+ {
47
+ "label": "test (nox)",
48
+ "type": "shell",
49
+ "command": "nox",
50
+ "args": ["-s", "tests"],
51
+ "group": "test"
52
+ },
53
+ {
54
+ "label": "bump version",
55
+ "type": "shell",
56
+ "command": "mask",
57
+ "args": ["bump", "${input:patch_version}"],
58
+ "group": "build"
59
+ },
60
+ {
61
+ "label": "publish",
62
+ "type": "shell",
63
+ "command": "mask",
64
+ "args": ["publish"],
65
+ "group": "build"
66
+ }
67
+ ],
68
+ "inputs": [
69
+ {
70
+ "id": "patch_version",
71
+ "type": "pickString",
72
+ "description": "Version bump type",
73
+ "options": ["patch", "minor", "major"]
74
+ }
75
+ ]
76
+ }
@@ -1,32 +1,33 @@
1
1
  📁 bear-utils
2
- ├── ⚙️ .bumpversion.cfg (312 bytes) (12 lines)
2
+ ├── ⚙️ .bumpversion.cfg (183 bytes) (8 lines)
3
3
  ├── 🗃️ .gitignore (3170 bytes) (165 lines)
4
4
  ├── 🐍 .python-version (7 bytes) (1 lines)
5
- ├── 📄 AGENTS.md (2953 bytes) (12 lines)
6
- ├── 📄 directory_structure.txt (7154 bytes) (118 lines)
7
- ├── 📄 pyproject.toml (970 bytes) (41 lines)
8
- ├── 📄 README.md (5267 bytes) (208 lines)
5
+ ├── 📄 AGENTS.md (2421 bytes) (11 lines)
6
+ ├── 📄 directory_structure.txt (7429 bytes) (120 lines)
7
+ ├── 📄 maskfile.md (1011 bytes) (57 lines)
8
+ ├── 📄 pyproject.toml (1275 bytes) (52 lines)
9
+ ├── 📄 README.md (7823 bytes) (277 lines)
9
10
  ├── 📁 src
10
11
  │ └── 📁 bear_utils
11
- │ ├── 🐍 __init__.py (616 bytes) (13 lines)
12
+ │ ├── 🐍 __init__.py (670 bytes) (15 lines)
12
13
  │ ├── 📁 ai
13
- │ │ ├── 🐍 __init__.py (26 bytes) (1 lines)
14
+ │ │ ├── 🐍 __init__.py (766 bytes) (30 lines)
14
15
  │ │ └── 📁 ai_helpers
15
16
  │ │ ├── 🐍 __init__.py (3968 bytes) (130 lines)
16
17
  │ │ ├── 🐍 _common.py (418 bytes) (19 lines)
17
- │ │ ├── 🐍 _config.py (789 bytes) (25 lines)
18
+ │ │ ├── 🐍 _config.py (774 bytes) (24 lines)
18
19
  │ │ ├── 🐍 _parsers.py (7993 bytes) (188 lines)
19
20
  │ │ └── 🐍 _types.py (550 bytes) (20 lines)
20
21
  │ ├── 📁 cache
21
- │ │ └── 🐍 __init__.py (4101 bytes) (119 lines)
22
+ │ │ └── 🐍 __init__.py (4109 bytes) (119 lines)
22
23
  │ ├── 📁 cli
23
- │ │ ├── 🐍 __init__.py (241 bytes) (4 lines)
24
- │ │ ├── 🐍 commands.py (1768 bytes) (65 lines)
24
+ │ │ ├── 🐍 __init__.py (239 bytes) (4 lines)
25
+ │ │ ├── 🐍 commands.py (2806 bytes) (99 lines)
25
26
  │ │ ├── 🐍 prompt_helpers.py (6094 bytes) (166 lines)
26
27
  │ │ └── 📁 shell
27
28
  │ │ ├── 🐍 __init__.py (0 bytes) (0 lines)
28
- │ │ ├── 🐍 _base_command.py (2251 bytes) (74 lines)
29
- │ │ ├── 🐍 _base_shell.py (14596 bytes) (390 lines)
29
+ │ │ ├── 🐍 _base_command.py (2360 bytes) (75 lines)
30
+ │ │ ├── 🐍 _base_shell.py (15941 bytes) (440 lines)
30
31
  │ │ └── 🐍 _common.py (669 bytes) (19 lines)
31
32
  │ ├── 📁 config
32
33
  │ │ ├── 🐍 __init__.py (289 bytes) (11 lines)
@@ -37,20 +38,24 @@
37
38
  │ │ ├── 🐍 __init__.py (545 bytes) (16 lines)
38
39
  │ │ ├── 🐍 _exceptions.py (137 bytes) (3 lines)
39
40
  │ │ ├── 🐍 _lazy_typing.py (339 bytes) (15 lines)
40
- │ │ ├── 🐍 date_related.py (935 bytes) (27 lines)
41
- │ │ └── 🐍 time_related.py (638 bytes) (22 lines)
41
+ │ │ ├── 🐍 date_related.py (582 bytes) (25 lines)
42
+ │ │ ├── 🐍 logger_protocol.py (760 bytes) (28 lines)
43
+ │ │ └── 🐍 time_related.py (705 bytes) (24 lines)
42
44
  │ ├── 🛢️ database
43
45
  │ │ ├── 🐍 __init__.py (111 bytes) (6 lines)
44
- │ │ └── 🐍 _db_manager.py (3782 bytes) (104 lines)
46
+ │ │ └── 🐍 _db_manager.py (3776 bytes) (104 lines)
45
47
  │ ├── 📁 events
46
48
  │ │ ├── 🐍 __init__.py (364 bytes) (16 lines)
47
49
  │ │ ├── 🐍 events_class.py (1657 bytes) (52 lines)
48
50
  │ │ └── 🐍 events_module.py (1852 bytes) (65 lines)
49
51
  │ ├── 📁 extras
50
- │ │ ├── 🐍 __init__.py (484 bytes) (17 lines)
52
+ │ │ ├── 🐍 __init__.py (547 bytes) (20 lines)
51
53
  │ │ ├── 🐍 _async_helpers.py (416 bytes) (15 lines)
52
- │ │ ├── 🐍 _tools.py (5959 bytes) (174 lines)
54
+ │ │ ├── 🐍 _tools.py (7416 bytes) (217 lines)
53
55
  │ │ ├── 🐍 platform_utils.py (1257 bytes) (53 lines)
56
+ │ │ ├── 📁 responses
57
+ │ │ │ ├── 🐍 __init__.py (0 bytes) (0 lines)
58
+ │ │ │ └── 🐍 function_response.py (12718 bytes) (301 lines)
54
59
  │ │ └── 📁 wrappers
55
60
  │ │ ├── 🐍 __init__.py (0 bytes) (0 lines)
56
61
  │ │ └── 🐍 add_methods.py (4222 bytes) (98 lines)
@@ -60,19 +65,20 @@
60
65
  │ │ └── 📁 file_handlers
61
66
  │ │ ├── 🐍 __init__.py (87 bytes) (3 lines)
62
67
  │ │ ├── 🐍 _base_file_handler.py (3164 bytes) (93 lines)
63
- │ │ ├── 🐍 file_handler_factory.py (9746 bytes) (278 lines)
68
+ │ │ ├── 🐍 file_handler_factory.py (9856 bytes) (280 lines)
64
69
  │ │ ├── 🐍 json_file_handler.py (1482 bytes) (44 lines)
65
70
  │ │ ├── 🐍 log_file_handler.py (1246 bytes) (33 lines)
71
+ │ │ ├── 🐍 toml_file_handler.py (2287 bytes) (68 lines)
66
72
  │ │ ├── 🐍 txt_file_handler.py (1250 bytes) (34 lines)
67
73
  │ │ └── 🐍 yaml_file_handler.py (2083 bytes) (57 lines)
68
74
  │ ├── 📁 graphics
69
- │ │ ├── 🐍 __init__.py (186 bytes) (4 lines)
70
- │ │ ├── 🐍 bear_gradient.py (4769 bytes) (140 lines)
75
+ │ │ ├── 🐍 __init__.py (218 bytes) (4 lines)
76
+ │ │ ├── 🐍 bear_gradient.py (4808 bytes) (140 lines)
71
77
  │ │ └── 🐍 image_helpers.py (1374 bytes) (39 lines)
72
78
  │ ├── 📁 gui
73
- │ │ ├── 🐍 __init__.py (118 bytes) (3 lines)
79
+ │ │ ├── 🐍 __init__.py (274 bytes) (6 lines)
74
80
  │ │ └── 📁 gui_tools
75
- │ │ ├── 🐍 __init__.py (171 bytes) (5 lines)
81
+ │ │ ├── 🐍 __init__.py (335 bytes) (8 lines)
76
82
  │ │ ├── 🐍 _settings.py (1202 bytes) (37 lines)
77
83
  │ │ ├── 🐍 _types.py (248 bytes) (12 lines)
78
84
  │ │ ├── 🐍 qt_app.py (5520 bytes) (145 lines)
@@ -80,20 +86,21 @@
80
86
  │ │ ├── 🐍 qt_file_handler.py (4325 bytes) (138 lines)
81
87
  │ │ └── 🐍 qt_input_dialog.py (9224 bytes) (306 lines)
82
88
  │ ├── 📁 logging
83
- │ │ ├── 🐍 __init__.py (319 bytes) (12 lines)
84
- │ │ ├── 🐍 loggers.py (4507 bytes) (91 lines)
89
+ │ │ ├── 🐍 __init__.py (492 bytes) (25 lines)
90
+ │ │ ├── 🐍 loggers.py (3196 bytes) (76 lines)
85
91
  │ │ └── 📁 logger_manager
86
92
  │ │ ├── 🐍 __init__.py (0 bytes) (0 lines)
87
93
  │ │ ├── 🐍 _common.py (1582 bytes) (47 lines)
88
94
  │ │ ├── 🐍 _console_junk.py (4821 bytes) (131 lines)
89
- │ │ ├── 🐍 _styles.py (2536 bytes) (91 lines)
95
+ │ │ ├── 🐍 _styles.py (2528 bytes) (91 lines)
90
96
  │ │ └── 📁 loggers
91
97
  │ │ ├── 🐍 __init__.py (0 bytes) (0 lines)
92
98
  │ │ ├── 🐍 _base_logger.py (9453 bytes) (238 lines)
93
99
  │ │ ├── 📄 _base_logger.pyi (2606 bytes) (50 lines)
94
- │ │ ├── 🐍 _console_logger.py (9126 bytes) (243 lines)
95
- │ │ ├── 📄 _console_logger.pyi (1470 bytes) (41 lines)
96
- │ │ ├── 🐍 _file_logger.py (5365 bytes) (150 lines)
100
+ │ │ ├── 🐍 _buffer_logger.py (1535 bytes) (55 lines)
101
+ │ │ ├── 🐍 _console_logger.py (9400 bytes) (249 lines)
102
+ │ │ ├── 📄 _console_logger.pyi (2512 bytes) (64 lines)
103
+ │ │ ├── 🐍 _file_logger.py (4684 bytes) (141 lines)
97
104
  │ │ ├── 🐍 _level_sin.py (1712 bytes) (58 lines)
98
105
  │ │ ├── 🐍 _logger.py (547 bytes) (18 lines)
99
106
  │ │ ├── 🐍 _sub_logger.py (3471 bytes) (110 lines)
@@ -102,17 +109,12 @@
102
109
  │ │ ├── 🐍 __init__.py (168 bytes) (10 lines)
103
110
  │ │ └── 🐍 host_monitor.py (12902 bytes) (350 lines)
104
111
  │ └── 📁 time
105
- ├── 🐍 __init__.py (398 bytes) (16 lines)
106
- │ ├── 🐍 _helpers.py (2824 bytes) (91 lines)
107
- │ ├── 🐍 _time_class.py (11425 bytes) (316 lines)
108
- │ ├── 🐍 _timer.py (2463 bytes) (80 lines)
109
- │ ├── 🐍 _tools.py (456 bytes) (17 lines)
110
- │ └── 🐍 time_manager.py (7731 bytes) (218 lines)
112
+ └── 🐍 __init__.py (721 bytes) (30 lines)
111
113
  └── 📁 tests
112
114
  ├── 🐍 __init__.py (0 bytes) (0 lines)
113
115
  ├── 🐍 test_add_ord_suffix.py (329 bytes) (12 lines)
114
116
  ├── 🐍 test_clipboard.py (1799 bytes) (50 lines)
115
117
  ├── 🐍 test_default_shell.py (154 bytes) (7 lines)
116
- ├── 🐍 test_logger.py (8513 bytes) (227 lines)
117
- ├── 🐍 test_platform_utils.py (922 bytes) (35 lines)
118
- └── 🐍 test_time_parsing.py (414 bytes) (13 lines)
118
+ ├── 🐍 test_gradient.py (1879 bytes) (49 lines)
119
+ ├── 🐍 test_logger.py (11846 bytes) (306 lines)
120
+ └── 🐍 test_platform_utils.py (922 bytes) (35 lines)