Skip to main content

DPN Python Utils

Coverage Python 3.12+ License

A collection of python utils used by the DPN.

Target minimum python version: 3.12

Documentation and Examples

📚 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!

High-level Design Notes

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

Getting Started

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 sync

This will create a virtual environment with dpn_pyutils installed.

Upgrade versions

Upgrading is done by uninstalling the package and installing the upgraded version

uv sync --upgrade-package dpn_pyutils

Testing

This project uses uv and tox via the tox-uv plugin. Set it up via:

uv tool install tox --with tox-uv

Building

Building dpn_pyutils can be done with python 3 and poetry

uv run pytest tests/
tox
uv build

The distribution-ready files will be in the dist/ directory.

Packaging and Distribution

Packaging after changes need the following to be executed:

Update the version number

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 --tags

Distribute

uv build && uv publish && rm -rf dist

Remember to set the username to __token__ and the password to your PyPI token.

Metadata

Release files for dpn_pyutils 3.12.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dpn_pyutils 3.12.11
File Size Uploaded
dpn_pyutils-3.12.11.tar.gz 24.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dpn_pyutils 3.12.11
File Interpreter ABI Platform
dpn_pyutils-3.12.11-py3-none-any.whl Python 3 none any Details

Total release size: 53.5 kB

Release files / dpn_pyutils-3.12.11.tar.gz

Download URL dpn_pyutils-3.12.11.tar.gz
Size 24.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c121a948f9b6e0a5460663ce652659e16fbe4c96c53829e4b6d92a0d1897574b
BLAKE2b-256 checksum
How to use checksums
54c7091bfb8653ef0f897b2d69fad6fad1a12150600d2af49dc54b5b13fe57d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.13

Release files / dpn_pyutils-3.12.11-py3-none-any.whl

Download URL dpn_pyutils-3.12.11-py3-none-any.whl
Size 29.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
101c575a3d028a92422af581edf1a3d5f9bf65cbc3561c9816bf0b0572c97c90
BLAKE2b-256 checksum
How to use checksums
330fdf6975e7c86474792ba2aeb44d1c7c4f3a5bac2ed61d57383122bdf7aeb0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.13

Release history Release notifications | RSS feed

This release

3.12.11 This release

2 release files

3.12.9

2 release files

3.12.8

2 release files

3.12.7

2 release files

3.12.6

2 release files

3.12.5

2 release files

3.12.4

2 release files

3.12.3

2 release files

3.8.10

2 release files

3.0.5

2 release files

3.0.4

2 release files

3.0.3

2 release files

3.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page