pygenutils 16.3.2__tar.gz → 17.2.1__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 (48) hide show
  1. {pygenutils-16.3.2 → pygenutils-17.2.1}/LICENSE +1 -1
  2. {pygenutils-16.3.2/pygenutils.egg-info → pygenutils-17.2.1}/PKG-INFO +43 -59
  3. {pygenutils-16.3.2 → pygenutils-17.2.1}/README.md +34 -33
  4. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/__init__.py +1 -1
  5. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/arrays_and_lists/conversions.py +1 -1
  6. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/arrays_and_lists/data_manipulation.py +3 -3
  7. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/arrays_and_lists/patterns.py +1 -1
  8. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/audio_and_video/audio_and_video_manipulation.py +1 -1
  9. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/audio_and_video/merge_audio_and_video.py +29 -33
  10. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/audio_and_video/merge_audio_or_video.py +8 -3
  11. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/audio_and_video/trim_media.py +8 -3
  12. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/dictionaries/dict_handler.py +1 -1
  13. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/dictionaries/dict_operators.py +1 -1
  14. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/number_bases/base_converters.py +15 -14
  15. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/number_bases/bitwise_operators.py +1 -1
  16. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/sets_and_intervals/interval_handler.py +2 -2
  17. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/sets_and_intervals/sets_handler.py +5 -3
  18. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/strings/string_handler.py +53 -19
  19. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/strings/text_formatters.py +1 -1
  20. pygenutils-17.2.1/pygenutils/time_handling/_optional_climate.py +44 -0
  21. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/time_handling/calendar_utils.py +7 -4
  22. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/time_handling/countdown.py +30 -15
  23. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/time_handling/date_and_time_maths.py +3 -6
  24. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/time_handling/date_and_time_utils.py +39 -14
  25. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/time_handling/program_snippet_exec_timers.py +1 -1
  26. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/time_handling/time_formatters.py +1 -1
  27. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/time_handling/time_utils.py +1 -1
  28. {pygenutils-16.3.2 → pygenutils-17.2.1/pygenutils.egg-info}/PKG-INFO +43 -59
  29. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils.egg-info/SOURCES.txt +1 -1
  30. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils.egg-info/requires.txt +8 -4
  31. {pygenutils-16.3.2 → pygenutils-17.2.1}/pyproject.toml +12 -7
  32. pygenutils-16.3.2/MANIFEST.in +0 -7
  33. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/arrays_and_lists/__init__.py +0 -0
  34. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/arrays_and_lists/maths.py +0 -0
  35. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/audio_and_video/__init__.py +0 -0
  36. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/dictionaries/__init__.py +0 -0
  37. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/number_bases/__init__.py +0 -0
  38. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/number_bases/binary_operations.py +0 -0
  39. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/number_bases/mathematical_utils.py +0 -0
  40. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/operative_systems/__init__.py +0 -0
  41. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/operative_systems/os_operations.py +0 -0
  42. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/sets_and_intervals/__init__.py +0 -0
  43. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/strings/__init__.py +0 -0
  44. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils/time_handling/__init__.py +0 -0
  45. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils.egg-info/dependency_links.txt +0 -0
  46. {pygenutils-16.3.2 → pygenutils-17.2.1}/pygenutils.egg-info/top_level.txt +0 -0
  47. {pygenutils-16.3.2 → pygenutils-17.2.1}/setup.cfg +0 -0
  48. {pygenutils-16.3.2 → pygenutils-17.2.1}/setup.py +0 -0
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
18
  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
21
+ SOFTWARE.
@@ -1,29 +1,9 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pygenutils
3
- Version: 16.3.2
3
+ Version: 17.2.1
4
4
  Summary: A comprehensive Python utility library for general-purpose and specialised tasks
5
5
  Author-email: Jon Ander Gabantxo <jagabantxo@gmail.com>
6
- License: MIT License
7
-
8
- Copyright (c) 2024 Jon Ander Gabantxo
9
-
10
- Permission is hereby granted, free of charge, to any person obtaining a copy
11
- of this software and associated documentation files (the "Software"), to deal
12
- in the Software without restriction, including without limitation the rights
13
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
- copies of the Software, and to permit persons to whom the Software is
15
- furnished to do so, subject to the following conditions:
16
-
17
- The above copyright notice and this permission notice shall be included in all
18
- copies or substantial portions of the Software.
19
-
20
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
- SOFTWARE.
6
+ License-Expression: MIT
27
7
  Project-URL: Homepage, https://github.com/EusDancerDev/pygenutils
28
8
  Project-URL: Documentation, https://github.com/EusDancerDev/pygenutils#readme
29
9
  Project-URL: Repository, https://github.com/EusDancerDev/pygenutils.git
@@ -43,10 +23,12 @@ Requires-Python: >=3.10
43
23
  Description-Content-Type: text/markdown
44
24
  License-File: LICENSE
45
25
  Requires-Dist: more_itertools>=10.0.0
46
- Requires-Dist: numpy<2.0.0,>=1.21.0
47
- Requires-Dist: pandas<2.0.0,>=1.3.0
48
- Requires-Dist: filewise>=3.11.6
49
- Requires-Dist: paramlib>=3.4.10
26
+ Requires-Dist: numpy>=2.2.3
27
+ Requires-Dist: pandas>=2.2.3
28
+ Requires-Dist: intervaltree>=3.1.0
29
+ Requires-Dist: paramlib>=3.6.0
30
+ Provides-Extra: climate
31
+ Requires-Dist: climarraykit>=0.2.1; extra == "climate"
50
32
  Provides-Extra: xarray
51
33
  Requires-Dist: xarray>=2024.2.0; extra == "xarray"
52
34
  Provides-Extra: arrow
@@ -58,12 +40,13 @@ Requires-Dist: black>=23.0.0; extra == "dev"
58
40
  Requires-Dist: isort>=5.0.0; extra == "dev"
59
41
  Requires-Dist: mypy>=1.0.0; extra == "dev"
60
42
  Requires-Dist: flake8>=6.0.0; extra == "dev"
43
+ Requires-Dist: climarraykit>=0.2.1; extra == "dev"
61
44
  Dynamic: license-file
62
45
 
63
46
  # pygenutils
64
47
 
65
48
  [![Python Version](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/downloads/)
66
- [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
49
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/EusDancerDev/pygenutils/blob/main/LICENSE)
67
50
  [![PyPI Version](https://img.shields.io/pypi/v/pygenutils.svg)](https://pypi.org/project/pygenutils/)
68
51
 
69
52
  **pygenutils** is a comprehensive Python utilities package designed to provide a wide range of general-purpose tools for data manipulation, string handling, time operations, and system interactions. It serves as a collection of commonly needed utilities for Python development.
@@ -119,15 +102,18 @@ This package has minimal external dependencies and is designed to be lightweight
119
102
 
120
103
  ```bash
121
104
  pip install pygenutils # Core functionality
122
- pip install pygenutils[arrow] # With arrow support (optional)
105
+ pip install 'pygenutils[climate]' # NetCDF / climarraykit features in time_handling
106
+ pip install pygenutils[arrow] # Arrow support (optional)
123
107
  ```
124
108
 
125
- This automatically installs `pygenutils` and all its dependencies with version constraints.
109
+ Core install pulls **numpy**, **pandas**, **filewise**, **paramlib**, and **more_itertools**. **climarraykit** (and thus **xarray** for those code paths) is optional.
126
110
 
127
- **How It Works Now**:
111
+ **Optional extras**:
128
112
 
129
- - `pip install pygenutils` - Core functionality without arrow dependency
130
- - `pip install pygenutils[arrow]` - With arrow support for enhanced time handling features
113
+ - `pip install pygenutils` — core only (no climarraykit)
114
+ - `pip install 'pygenutils[climate]'` — NetCDF helpers (`ncfile_integrity_status`, `get_file_dimensions` proxies)
115
+ - `pip install pygenutils[arrow]` — Arrow for enhanced time handling
116
+ - `pip install pygenutils[xarray]` — xarray only (rare; prefer `[climate]` for climarraykit-backed APIs)
131
117
 
132
118
  ### Package Updates
133
119
 
@@ -151,10 +137,10 @@ git clone https://github.com/EusDancerDev/pygenutils.git
151
137
  cd pygenutils
152
138
 
153
139
  # Install with development dependencies (includes latest Git versions)
154
- pip install -e .[dev]
140
+ pip install .[dev]
155
141
  ```
156
142
 
157
- **Note**: The `-e` flag installs the package in "editable" mode, meaning changes to the source code are immediately reflected without reinstalling. The `[dev]` flag includes the latest Git versions of interdependent packages.
143
+ **Note**: The `[dev]` extra includes development tools **and** `climarraykit` so time-handling tests and NetCDF code paths work without a separate `[climate]` install.
158
144
 
159
145
  #### Alternative Setup (Explicit Git Dependencies)
160
146
 
@@ -168,11 +154,11 @@ cd pygenutils
168
154
  # Install development dependencies from requirements-dev.txt
169
155
  pip install -r requirements-dev.txt
170
156
 
171
- # Install in editable mode
172
- pip install -e .
157
+ # Install the local checkout (add [climate] if you skip Git climarraykit and need NetCDF features)
158
+ pip install .[dev]
173
159
  ```
174
160
 
175
- This approach gives you the latest development versions of all interdependent packages for testing and development.
161
+ This approach gives you Git checkouts of **filewise**, **climarraykit**, and **paramlib** plus pinned scientific stack; use **`pip install .[dev]`** so the local **pygenutils** matches **`pyproject.toml`** (including dev + climarraykit).
176
162
 
177
163
  #### Development with Optional Dependencies
178
164
 
@@ -180,10 +166,11 @@ For full development capabilities, including testing and linting:
180
166
 
181
167
  ```bash
182
168
  # Install with development dependencies
183
- pip install -e ".[dev]"
169
+ pip install ".[dev]"
184
170
 
185
171
  # Or install specific optional dependencies
186
- pip install -e ".[xarray]" # For xarray support
172
+ pip install ".[climate]" # climarraykit / NetCDF-related time_handling
173
+ pip install ".[xarray]" # xarray only (optional; [climate] is usually preferred)
187
174
  ```
188
175
 
189
176
  ### For Multiple Package Development
@@ -194,20 +181,22 @@ If you're working on multiple interdependent packages simultaneously:
194
181
  # Clone all repositories
195
182
  git clone https://github.com/EusDancerDev/pygenutils.git
196
183
  git clone https://github.com/EusDancerDev/filewise.git
184
+ git clone https://github.com/EusDancerDev/climarraykit.git
197
185
  git clone https://github.com/EusDancerDev/paramlib.git
198
186
 
199
- # Install each in editable mode
200
- pip install -e ./filewise
201
- pip install -e ./paramlib
202
- pip install -e ./pygenutils
187
+ # Install each from its local checkout (order: dependencies first)
188
+ pip install ./filewise
189
+ pip install ./paramlib
190
+ pip install ./climarraykit
191
+ pip install ./pygenutils[dev]
203
192
  ```
204
193
 
205
194
  ### Troubleshooting
206
195
 
207
196
  If you encounter import errors after cloning:
208
197
 
209
- 1. **For regular users**: Run `pip install pygenutils` (all dependencies included)
210
- 2. **For developers**: Run `pip install -e .[dev]` to include development dependencies
198
+ 1. **For regular users**: Run `pip install pygenutils` (core dependencies) or `pip install 'pygenutils[climate]'` for NetCDF/climarraykit features
199
+ 2. **For developers**: Run `pip install .[dev]` (includes dev tools and climarraykit)
211
200
  3. **Verify Python environment**: Make sure you're using a compatible Python version (3.10+)
212
201
 
213
202
  ### Verify Installation
@@ -227,21 +216,16 @@ try:
227
216
 
228
217
  except ImportError as e:
229
218
  print(f"❌ Import error: {e}")
230
- print("💡 For regular users: pip install pygenutils")
231
- print("💡 For developers: pip install -e .[dev]")
219
+ print("💡 For regular users: pip install pygenutils # add [climate] for NetCDF features")
220
+ print("💡 For developers: pip install .[dev]")
232
221
  ```
233
222
 
234
223
  ### Implementation Notes
235
224
 
236
- This project implements a **dual-approach dependency management** system:
237
-
238
- - **Production Dependencies**: Version-constrained dependencies for PyPI compatibility
239
- - **Development Dependencies**: Git-based dependencies for latest development versions
240
- - **Installation Methods**:
241
- - **Regular users**: Simple `pip install pygenutils` with all dependencies included
242
- - **Developers**: `pip install -e .[dev]` for latest Git versions and development tools
243
- - **PyPI Compatibility**: All packages can be published without Git dependency issues
244
- - **Development Flexibility**: Contributors get access to latest versions for testing and development
225
+ - **Core PyPI dependencies**: **more_itertools**, **numpy**, **pandas**, **filewise**, **paramlib**.
226
+ - **Optional `[climate]`**: **climarraykit** (pulls **xarray**) for NetCDF-related helpers in `time_handling`.
227
+ - **Optional `[dev]`**: development tools plus **climarraykit** for a full local test stack.
228
+ - **Git-based `requirements-dev.txt`**: optional bleeding-edge **filewise**, **climarraykit**, **paramlib** before `pip install .[dev]`.
245
229
 
246
230
  ### Package Structure
247
231
 
@@ -284,8 +268,8 @@ The package is organised into several specialised modules:
284
268
 
285
269
  For detailed version history and changes, please refer to:
286
270
 
287
- - `CHANGELOG.md`: Comprehensive list of changes for each version
288
- - `VERSIONING.md`: Versioning policy and guidelines
271
+ - [Changelog](https://github.com/EusDancerDev/pygenutils/blob/main/pygenutils/CHANGELOG.md): comprehensive list of changes for each version
272
+ - [Versioning](https://github.com/EusDancerDev/pygenutils/blob/main/pygenutils/VERSIONING.md): versioning policy and guidelines
289
273
 
290
274
  ## Usage Examples
291
275
 
@@ -350,4 +334,4 @@ Contributions are welcome! Please feel free to submit a Pull Request. For major
350
334
 
351
335
  ## License
352
336
 
353
- This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
337
+ This project is licensed under the MIT License — see the [LICENSE](https://github.com/EusDancerDev/pygenutils/blob/main/LICENSE) file in the repository for details.
@@ -1,7 +1,7 @@
1
1
  # pygenutils
2
2
 
3
3
  [![Python Version](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/downloads/)
4
- [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
4
+ [![License](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/EusDancerDev/pygenutils/blob/main/LICENSE)
5
5
  [![PyPI Version](https://img.shields.io/pypi/v/pygenutils.svg)](https://pypi.org/project/pygenutils/)
6
6
 
7
7
  **pygenutils** is a comprehensive Python utilities package designed to provide a wide range of general-purpose tools for data manipulation, string handling, time operations, and system interactions. It serves as a collection of commonly needed utilities for Python development.
@@ -57,15 +57,18 @@ This package has minimal external dependencies and is designed to be lightweight
57
57
 
58
58
  ```bash
59
59
  pip install pygenutils # Core functionality
60
- pip install pygenutils[arrow] # With arrow support (optional)
60
+ pip install 'pygenutils[climate]' # NetCDF / climarraykit features in time_handling
61
+ pip install pygenutils[arrow] # Arrow support (optional)
61
62
  ```
62
63
 
63
- This automatically installs `pygenutils` and all its dependencies with version constraints.
64
+ Core install pulls **numpy**, **pandas**, **filewise**, **paramlib**, and **more_itertools**. **climarraykit** (and thus **xarray** for those code paths) is optional.
64
65
 
65
- **How It Works Now**:
66
+ **Optional extras**:
66
67
 
67
- - `pip install pygenutils` - Core functionality without arrow dependency
68
- - `pip install pygenutils[arrow]` - With arrow support for enhanced time handling features
68
+ - `pip install pygenutils` — core only (no climarraykit)
69
+ - `pip install 'pygenutils[climate]'` — NetCDF helpers (`ncfile_integrity_status`, `get_file_dimensions` proxies)
70
+ - `pip install pygenutils[arrow]` — Arrow for enhanced time handling
71
+ - `pip install pygenutils[xarray]` — xarray only (rare; prefer `[climate]` for climarraykit-backed APIs)
69
72
 
70
73
  ### Package Updates
71
74
 
@@ -89,10 +92,10 @@ git clone https://github.com/EusDancerDev/pygenutils.git
89
92
  cd pygenutils
90
93
 
91
94
  # Install with development dependencies (includes latest Git versions)
92
- pip install -e .[dev]
95
+ pip install .[dev]
93
96
  ```
94
97
 
95
- **Note**: The `-e` flag installs the package in "editable" mode, meaning changes to the source code are immediately reflected without reinstalling. The `[dev]` flag includes the latest Git versions of interdependent packages.
98
+ **Note**: The `[dev]` extra includes development tools **and** `climarraykit` so time-handling tests and NetCDF code paths work without a separate `[climate]` install.
96
99
 
97
100
  #### Alternative Setup (Explicit Git Dependencies)
98
101
 
@@ -106,11 +109,11 @@ cd pygenutils
106
109
  # Install development dependencies from requirements-dev.txt
107
110
  pip install -r requirements-dev.txt
108
111
 
109
- # Install in editable mode
110
- pip install -e .
112
+ # Install the local checkout (add [climate] if you skip Git climarraykit and need NetCDF features)
113
+ pip install .[dev]
111
114
  ```
112
115
 
113
- This approach gives you the latest development versions of all interdependent packages for testing and development.
116
+ This approach gives you Git checkouts of **filewise**, **climarraykit**, and **paramlib** plus pinned scientific stack; use **`pip install .[dev]`** so the local **pygenutils** matches **`pyproject.toml`** (including dev + climarraykit).
114
117
 
115
118
  #### Development with Optional Dependencies
116
119
 
@@ -118,10 +121,11 @@ For full development capabilities, including testing and linting:
118
121
 
119
122
  ```bash
120
123
  # Install with development dependencies
121
- pip install -e ".[dev]"
124
+ pip install ".[dev]"
122
125
 
123
126
  # Or install specific optional dependencies
124
- pip install -e ".[xarray]" # For xarray support
127
+ pip install ".[climate]" # climarraykit / NetCDF-related time_handling
128
+ pip install ".[xarray]" # xarray only (optional; [climate] is usually preferred)
125
129
  ```
126
130
 
127
131
  ### For Multiple Package Development
@@ -132,20 +136,22 @@ If you're working on multiple interdependent packages simultaneously:
132
136
  # Clone all repositories
133
137
  git clone https://github.com/EusDancerDev/pygenutils.git
134
138
  git clone https://github.com/EusDancerDev/filewise.git
139
+ git clone https://github.com/EusDancerDev/climarraykit.git
135
140
  git clone https://github.com/EusDancerDev/paramlib.git
136
141
 
137
- # Install each in editable mode
138
- pip install -e ./filewise
139
- pip install -e ./paramlib
140
- pip install -e ./pygenutils
142
+ # Install each from its local checkout (order: dependencies first)
143
+ pip install ./filewise
144
+ pip install ./paramlib
145
+ pip install ./climarraykit
146
+ pip install ./pygenutils[dev]
141
147
  ```
142
148
 
143
149
  ### Troubleshooting
144
150
 
145
151
  If you encounter import errors after cloning:
146
152
 
147
- 1. **For regular users**: Run `pip install pygenutils` (all dependencies included)
148
- 2. **For developers**: Run `pip install -e .[dev]` to include development dependencies
153
+ 1. **For regular users**: Run `pip install pygenutils` (core dependencies) or `pip install 'pygenutils[climate]'` for NetCDF/climarraykit features
154
+ 2. **For developers**: Run `pip install .[dev]` (includes dev tools and climarraykit)
149
155
  3. **Verify Python environment**: Make sure you're using a compatible Python version (3.10+)
150
156
 
151
157
  ### Verify Installation
@@ -165,21 +171,16 @@ try:
165
171
 
166
172
  except ImportError as e:
167
173
  print(f"❌ Import error: {e}")
168
- print("💡 For regular users: pip install pygenutils")
169
- print("💡 For developers: pip install -e .[dev]")
174
+ print("💡 For regular users: pip install pygenutils # add [climate] for NetCDF features")
175
+ print("💡 For developers: pip install .[dev]")
170
176
  ```
171
177
 
172
178
  ### Implementation Notes
173
179
 
174
- This project implements a **dual-approach dependency management** system:
175
-
176
- - **Production Dependencies**: Version-constrained dependencies for PyPI compatibility
177
- - **Development Dependencies**: Git-based dependencies for latest development versions
178
- - **Installation Methods**:
179
- - **Regular users**: Simple `pip install pygenutils` with all dependencies included
180
- - **Developers**: `pip install -e .[dev]` for latest Git versions and development tools
181
- - **PyPI Compatibility**: All packages can be published without Git dependency issues
182
- - **Development Flexibility**: Contributors get access to latest versions for testing and development
180
+ - **Core PyPI dependencies**: **more_itertools**, **numpy**, **pandas**, **filewise**, **paramlib**.
181
+ - **Optional `[climate]`**: **climarraykit** (pulls **xarray**) for NetCDF-related helpers in `time_handling`.
182
+ - **Optional `[dev]`**: development tools plus **climarraykit** for a full local test stack.
183
+ - **Git-based `requirements-dev.txt`**: optional bleeding-edge **filewise**, **climarraykit**, **paramlib** before `pip install .[dev]`.
183
184
 
184
185
  ### Package Structure
185
186
 
@@ -222,8 +223,8 @@ The package is organised into several specialised modules:
222
223
 
223
224
  For detailed version history and changes, please refer to:
224
225
 
225
- - `CHANGELOG.md`: Comprehensive list of changes for each version
226
- - `VERSIONING.md`: Versioning policy and guidelines
226
+ - [Changelog](https://github.com/EusDancerDev/pygenutils/blob/main/pygenutils/CHANGELOG.md): comprehensive list of changes for each version
227
+ - [Versioning](https://github.com/EusDancerDev/pygenutils/blob/main/pygenutils/VERSIONING.md): versioning policy and guidelines
227
228
 
228
229
  ## Usage Examples
229
230
 
@@ -288,4 +289,4 @@ Contributions are welcome! Please feel free to submit a Pull Request. For major
288
289
 
289
290
  ## License
290
291
 
291
- This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
292
+ This project is licensed under the MIT License — see the [LICENSE](https://github.com/EusDancerDev/pygenutils/blob/main/LICENSE) file in the repository for details.
@@ -3,7 +3,7 @@
3
3
 
4
4
  # pygenutils/__init__.py
5
5
 
6
- __version__ = "16.3.2"
6
+ __version__ = "17.2.1"
7
7
 
8
8
  # Define what should be available when using 'from pygenutils import *'
9
9
  __all__ = [
@@ -11,7 +11,7 @@ import numpy as np
11
11
  # Import project modules #
12
12
  #------------------------#
13
13
 
14
- from filewise.general.introspection_utils import get_type_str
14
+ from paramlib.introspection_utils import get_type_str
15
15
  from pygenutils.arrays_and_lists.data_manipulation import flatten_list
16
16
 
17
17
  #------------------#
@@ -535,10 +535,10 @@ def flatten_list(lst, return_list=True, sort=False, reverse=False):
535
535
  [1, 2, 3, 4, 5, 6]
536
536
  """
537
537
  if return_list:
538
- flattened = list(_flatten_generator(lst))
538
+ flattened_list = list(_flatten_generator(lst))
539
539
  if sort:
540
- return sort_1d_basic(flattened, reverse=reverse)
541
- return flattened
540
+ return sort_1d_basic(flattened_list, reverse=reverse)
541
+ return flattened_list
542
542
  else:
543
543
  return _flatten_generator(lst)
544
544
 
@@ -15,7 +15,7 @@ from pandas import Series
15
15
  # Import project modules #
16
16
  #------------------------#
17
17
 
18
- from filewise.general.introspection_utils import get_type_str, get_caller_args
18
+ from paramlib.introspection_utils import get_type_str, get_caller_args
19
19
  from pygenutils.arrays_and_lists.data_manipulation import flatten_list, sort_1d_basic
20
20
  from pygenutils.strings.string_handler import find_substring_index
21
21
 
@@ -11,7 +11,7 @@ import os
11
11
  # Import project modules #
12
12
  #------------------------#
13
13
 
14
- from filewise.general.introspection_utils import get_caller_args
14
+ from paramlib.introspection_utils import get_caller_args
15
15
  from pygenutils.arrays_and_lists.data_manipulation import flatten_list
16
16
  from pygenutils.operative_systems.os_operations import run_system_command, exit_info
17
17
  from pygenutils.time_handling.time_formatters import parse_dt_string
@@ -13,7 +13,6 @@ but keep in mind that the module is designed to work with absolute paths.
13
13
  # Import project modules #
14
14
  #------------------------#
15
15
 
16
- from filewise.file_operations.path_utils import find_files
17
16
  from pygenutils.audio_and_video.audio_and_video_manipulation import merge_media_files
18
17
 
19
18
  #-------------------#
@@ -43,22 +42,6 @@ SEARCH_PATH = "(default_search_path)"
43
42
  # Set common keyword arguments #
44
43
  COMMON_KWARGS = dict(search_path=SEARCH_PATH, match_type="glob_left")
45
44
 
46
- # Find target audio and video files #
47
- INPUT_AUDIO_FILE_LIST = find_files(AUDIO_FILE_PATTERN, **COMMON_KWARGS)
48
- INPUT_VIDEO_FILE_LIST = find_files(VIDEO_FILE_PATTERN, **COMMON_KWARGS)
49
-
50
- # Output media #
51
- #--------------#
52
-
53
- # Name output file names manually #
54
- """Taking into account the names of the files, the simplest way to rename them is by removing the item type"""
55
-
56
- OUTPUT_FILE_NAME_LIST = [
57
- f"{input_audio_file.split(AUDIO_DELIMITER)[0][:-1]}.{VIDEO_EXTENSION}"
58
- for input_audio_file in INPUT_AUDIO_FILE_LIST
59
- ]
60
- # OUTPUT_FILE_NAME_LIST = None
61
-
62
45
  # Zero-padding and bitrate fractions #
63
46
  #-------------------------------------#
64
47
 
@@ -98,19 +81,32 @@ SHELL = True
98
81
  # Program operation #
99
82
  #-------------------#
100
83
 
101
- merge_media_files(
102
- INPUT_AUDIO_FILE_LIST,
103
- INPUT_VIDEO_FILE_LIST,
104
- output_file_list=OUTPUT_FILE_NAME_LIST,
105
- zero_padding=ZERO_PADDING,
106
- audio_bitrate_fraction=AUDIO_BITRATE_FRACTION,
107
- video_bitrate_fraction=VIDEO_BITRATE_FRACTION,
108
- video_codec=VIDEO_CODEC,
109
- audio_codec=AUDIO_CODEC,
110
- preset=PRESET,
111
- overwrite=OVERWRITE,
112
- capture_output=CAPTURE_OUTPUT,
113
- return_output_name=RETURN_OUTPUT_NAME,
114
- encoding=ENCODING,
115
- shell=SHELL
116
- )
84
+ def main():
85
+ from filewise.file_operations.path_utils import find_files
86
+
87
+ input_audio_file_list = find_files(AUDIO_FILE_PATTERN, **COMMON_KWARGS)
88
+ input_video_file_list = find_files(VIDEO_FILE_PATTERN, **COMMON_KWARGS)
89
+ output_file_name_list = [
90
+ f"{input_audio_file.split(AUDIO_DELIMITER)[0][:-1]}.{VIDEO_EXTENSION}"
91
+ for input_audio_file in input_audio_file_list
92
+ ]
93
+ merge_media_files(
94
+ input_audio_file_list,
95
+ input_video_file_list,
96
+ output_file_list=output_file_name_list,
97
+ zero_padding=ZERO_PADDING,
98
+ audio_bitrate_fraction=AUDIO_BITRATE_FRACTION,
99
+ video_bitrate_fraction=VIDEO_BITRATE_FRACTION,
100
+ video_codec=VIDEO_CODEC,
101
+ audio_codec=AUDIO_CODEC,
102
+ preset=PRESET,
103
+ overwrite=OVERWRITE,
104
+ capture_output=CAPTURE_OUTPUT,
105
+ return_output_name=RETURN_OUTPUT_NAME,
106
+ encoding=ENCODING,
107
+ shell=SHELL,
108
+ )
109
+
110
+
111
+ if __name__ == "__main__":
112
+ main()
@@ -84,7 +84,8 @@ SHELL = True
84
84
  # Program progression #
85
85
  #---------------------#
86
86
 
87
- merge_individual_media_files(
87
+ def main():
88
+ merge_individual_media_files(
88
89
  MEDIA_INPUT,
89
90
  safe=SAFE,
90
91
  output_file_name=OUTPUT_FILE_NAME,
@@ -97,5 +98,9 @@ merge_individual_media_files(
97
98
  capture_output=CAPTURE_OUTPUT,
98
99
  return_output_name=RETURN_OUTPUT_NAME,
99
100
  encoding=ENCODING,
100
- shell=SHELL
101
- )
101
+ shell=SHELL,
102
+ )
103
+
104
+
105
+ if __name__ == "__main__":
106
+ main()
@@ -85,7 +85,8 @@ SHELL = True
85
85
  # Program progression #
86
86
  #---------------------#
87
87
 
88
- cut_media_files(
88
+ def main():
89
+ cut_media_files(
89
90
  MEDIA_INPUT,
90
91
  START_TIME_LIST,
91
92
  END_TIME_LIST,
@@ -100,5 +101,9 @@ cut_media_files(
100
101
  capture_output=CAPTURE_OUTPUT,
101
102
  return_output_name=RETURN_OUTPUT_NAME,
102
103
  encoding=ENCODING,
103
- shell=SHELL
104
- )
104
+ shell=SHELL,
105
+ )
106
+
107
+
108
+ if __name__ == "__main__":
109
+ main()
@@ -5,7 +5,7 @@
5
5
  # Import project modules #
6
6
  #------------------------#
7
7
 
8
- from filewise.general.introspection_utils import get_type_str
8
+ from paramlib.introspection_utils import get_type_str
9
9
  from pygenutils.arrays_and_lists.data_manipulation import flatten_list
10
10
 
11
11
  #------------------#
@@ -13,7 +13,7 @@ from functools import reduce
13
13
 
14
14
  from paramlib.global_parameters import BASIC_ARITHMETIC_OPERATORS
15
15
  from pygenutils.arrays_and_lists.data_manipulation import flatten_list
16
- from pygenutils.dictionaries.dict_handler import sort_dictionary_by_keys
16
+ from pygenutils.dictionaries.dict_handler import sort_object_of_dictionaries as sort_dictionary_by_keys
17
17
 
18
18
  #------------------#
19
19
  # Define functions #
@@ -59,8 +59,8 @@ def _check_input_binary(b):
59
59
  str
60
60
  The binary number as a string without the 'b' or '0b' prefix.
61
61
  """
62
- b_clean = substring_replacer(substring_replacer(b, "b", ""), "0b", "")
63
- are_only_binaries = find_substring_index(b_clean, r"^[01]+$")
62
+ b_clean = substring_replacer(substring_replacer(b, "0b", ""), "b", "")
63
+ are_only_binaries = find_substring_index(b_clean, r"^[01]+$", advanced_search=True)
64
64
  if are_only_binaries == -1:
65
65
  raise ValueError("The input binary number is not in the correct format.")
66
66
  return b_clean
@@ -130,12 +130,12 @@ def dec2bin_basic(n):
130
130
  The binary representation of the input number.
131
131
  """
132
132
  n_checked = _check_input_int(n)
133
- b = "" # or '_bin', so that we understand the var name better?
133
+ bits_lsb_first = "" # LSB == Least Significant Bit
134
134
  while n_checked >= 1:
135
- floordiv, mod = divmod(n_checked,2)
136
- b += str(mod)
135
+ mod = n_checked % 2
136
+ bits_lsb_first += str(mod)
137
137
  n_checked //= 2
138
- return b[::-1]
138
+ return bits_lsb_first[::-1]
139
139
 
140
140
  # Advanced #
141
141
  #-#-#-#-#-#-
@@ -280,16 +280,17 @@ def bin2dec_basic(b, procedure="loop"):
280
280
  # Calculation #
281
281
  ###############
282
282
 
283
- if procedure == "list_comprehension":
284
- summands_iter = [int(b_checked[i]) * 2 ** pos for pos, i in enumerate(range(lb-1,-1,-1))]
285
- res = sum(summands_iter)
283
+ # Take the LSB at index 0 of reversed string — bit i contributes int(bit) * 2**i
284
+ b_lsb_first = b_checked[::-1]
286
285
 
287
- elif procedure == "loop":
288
- res = 0
289
- for pos, i in enumerate(range(lb-1,-1,-1)):
290
- res += int(b_checked[i]) * 2 ** pos
291
- return res
286
+ if procedure == "list_comprehension":
287
+ return sum(int(b_lsb_first[i]) * 2**i for i in range(lb))
292
288
 
289
+ res = 0
290
+ for i in range(lb):
291
+ res += int(b_lsb_first[i]) * 2**i
292
+ return res
293
+
293
294
 
294
295
  def oct2dec(n_oct):
295
296
  """
@@ -27,7 +27,7 @@ purpose.
27
27
  # Import project modules #
28
28
  #------------------------#
29
29
 
30
- from pygenutils.numeral_systems.base_converters import base2bin, bin2dec
30
+ from pygenutils.number_bases.base_converters import base2bin, bin2dec
31
31
 
32
32
  #-------------------------#
33
33
  # Define custom functions #
@@ -13,8 +13,8 @@ import pandas as pd
13
13
  # Import project modules #
14
14
  #------------------------#
15
15
 
16
- from filewise.instrospection_utils import get_caller_args
17
- from paramlib.global_parameters import INTERVALS_OPERATION_LIST
16
+ from paramlib.introspection_utils import get_caller_args
17
+ from paramlib.global_parameters import SET_OPERATIONS as INTERVALS_OPERATION_LIST
18
18
  from pygenutils.arrays_and_lists.data_manipulation import flatten_list
19
19
  from pygenutils.strings.string_handler import find_substring_index
20
20