A collection of tools to solve common Python development frustrations. "Z0Z_" indicates these are prototype solutions - they work, but might not be pretty.
Add oopsieKwargsie()
to your function: it intelligently converts string parameters to their proper boolean or None types.
Add a flexible parameter to your function, and use defineConcurrencyLimit()
to give users more control over concurrent processing by using intuitive ratios or counts:
- Use fractions (0.75 = 75% of CPUs)
- Specify exact counts (8 = use 8 CPUs)
- Use negative values (-2 = total CPUs minus 2)
intInnit()
rigorously validates and converts input lists to integers:
- Converts valid numeric types to integers
- Rejects non-whole numbers
- Provides clear error messages
- Perfect for validating user inputs
Use the pre-built test suites in pytest_parseParameters.py
to quickly test your implementations:
from Z0Z_tools.pytest_parseParameters import makeTestSuiteOopsieKwargsie
def test_a_function_with_bool():
smurfSuite = makeTestSuiteOopsieKwargsie(mySmurfyFunction)
for smurfName, smurfFunction in smurfSuite.items():
smurfFunction()
Extract and standardize values from complex data structures with stringItUp()
:
- Recursively unpack nested structures
- Convert all elements to strings
- Handle arbitrary iterables and custom objects
updateExtendPolishDictionaryLists()
can combine and clean dictionary data with optional:
- Duplicate removal
- List sorting
- Error handling for incompatible data
Load audio, readAudioFile()
, and save WAV files, writeWav()
, without the complexity:
- Automatic stereo conversion
- Sample rate control
- Multi-file batch processing, too:
loadWaveforms()
If you have a Python package that doesn't have an installation file, pipAnything()
creates a temporary setup environment to help pip
install the unpackaged code.
python -m Z0Z_tools.pipAnything <pathPackage>
Convert between paths easily with findRelativePath()
:
- Works with files or directories
- Handles paths on different branches
- Supports both string and Path-like inputs
- Returns platform-independent paths
pip install Z0Z-tools