A collection of python utils used by the DPN.
Target minimum python version: 3.12
📚 Comprehensive Examples and Documentation
Looking to get the most out of dpn_pyutils? Extensive documentation provides:
- Detailed Module Guides: In-depth explanations of each module's purpose and capabilities
- Practical Code Examples: Copy-pasteable examples showing real-world usage patterns
- Architecture Insights: Design decisions, best practices, and integration guidance
- Getting Started: Quick-start guides for both beginners and advanced users
Whether you're implementing CLI color formatting, secure token generation, robust file operations, powerful logging, or timezone-aware scheduling, examples will help you integrate dpn_pyutils effectively into your projects.
Start here → examples/README.md for comprehensive usage guidance!
To be broadly compatible with running in synchronous or asynchronous mode.
The principles behind the modules are to:
- Be dependable and provide least surprise
- Fail safe and raise informative exceptions
- Optimize code for readability and maintainability
- Design for backwards compatibility
Major versions of dpn_pyutils releases track major Python versions in general availability
The fastest way to get start is with Astral uv.
Otherwise, use pip install dpn_pyutils in your virtual environment.
With uv installed on the system, create an environment
uv init
uv add dpn_pyutils
uv syncThis will create a virtual environment with dpn_pyutils installed.
Upgrading is done by uninstalling the package and installing the upgraded version
uv sync --upgrade-package dpn_pyutilsThis project uses uv and tox via the tox-uv plugin. Set it up via:
uv tool install tox --with tox-uvBuilding dpn_pyutils can be done with python 3 and poetry
uv run pytest tests/
tox
uv buildThe distribution-ready files will be in the dist/ directory.
Packaging after changes need the following to be executed:
Bump the version number
- The MAJOR and MINOR versions should always match the minimum Python versions
- The PATCH version should be an incremental counter of library versions
uv lock
uv version --dry-run --bump patch
uv version --bump patch
git add pyproject.toml uv.lock
git commit -m "Bump version to $(uv version | awk '{print $2}')"
git tag "v$(uv version | awk '{print $2}')"
git push && git push --tagsuv build && uv publish && rm -rf distRemember to set the username to __token__ and the password to your PyPI token.