Utility functions by Peter Cullen Burbery, including date_time_stamp, compare_images, convert_blob_to_raw_github_url, validate_Windows_filename_with_reasons, and valid_Windows_filename
Project description
peter_cullen_burbery_python_functions
A utility package by Peter Cullen Burbery offering high-precision date/time formatting, image comparison tools, and system management helpers.
Available on PyPi at peter_cullen_burbery_python_functions.
📚 Documentation: Read the Docs (auto-generated via Sphinx)
For most up to date docs, please visit Read the Docs.
✨ Features
📅 date_time_functions
-
date_time_stamp()Returns a precise timestamp string including:
- Gregorian calendar date
- Time with nanosecond precision
- IANA time zone
- ISO week format (e.g.,
2025-W030-005) - Ordinal day of the year
Example:
2025-007-025 015.005.004.990819700 America/New_York 2025-W030-005 2025-206
🖼️ image_functions
-
compare_images(image_path_1, image_path_2)Compares two images using:
- 🔐 SHA-256 hash
- 🧮 Pixel-wise difference via
ImageChops - 📏 Structural Similarity Index (SSIM)
- 📊 ImageMagick absolute error metric (if available)
Outputs:
- Matching/difference status
- SSIM score
- Optional diff image (if images differ)
🛠️ system_management_functions
-
convert_blob_to_raw_github_url(blob_url: str)Converts a GitHub
blobURL to arawcontent URL.Example:
from peter_cullen_burbery_python_functions.system_management_functions import convert_blob_to_raw_github_url raw_url = convert_blob_to_raw_github_url("https://github.com/user/repo/blob/main/script.ps1") print(raw_url) # Output: https://github.com/user/repo/raw/main/script.ps1
-
validate_Windows_filename_with_reasons(name: str)Validates a Windows filename against Microsoft’s rules for illegal characters, reserved device names, and invalid trailing characters.
Returns a dictionary indicating whether the filename is valid, and if not, why.
Example:
from peter_cullen_burbery_python_functions.system_management_functions import validate_Windows_filename_with_reasons result = validate_Windows_filename_with_reasons("CON.txt") print(result) # Output: {'valid': False, 'problems': [{'character': 'CON', 'reason': 'Reserved device name: console'}]}
-
valid_Windows_filename(name: str)Lightweight check to determine whether a Windows filename is valid.
Returns a simple boolean (
TrueorFalse) based on the same rules used invalidate_Windows_filename_with_reasons().Example:
from peter_cullen_burbery_python_functions.system_management_functions import valid_Windows_filename print(valid_Windows_filename("normal_file.txt")) # True print(valid_Windows_filename("NUL.txt")) # False
📦 Installation
pip install peter-cullen-burbery-python-functions
🧪 Example Usage
from peter_cullen_burbery_python_functions.date_time_functions import date_time_stamp
from peter_cullen_burbery_python_functions.image_functions import compare_images
from peter_cullen_burbery_python_functions.system_management_functions import (
convert_blob_to_raw_github_url,
validate_Windows_filename_with_reasons,
valid_Windows_filename,
)
print("🕒 Timestamp:", date_time_stamp())
compare_images("image1.png", "image2.png")
url = "https://github.com/user/repo/blob/main/example.txt"
print("🔗 Raw URL:", convert_blob_to_raw_github_url(url))
filename = "COM1.txt"
print("📁 Validity with reasons:", validate_Windows_filename_with_reasons(filename))
print("✅ Is valid?", valid_Windows_filename(filename))
📘 Documentation
This package uses Sphinx and the sphinx_rtd_theme to build documentation.
To build docs locally:
cd docs
make html
The output will be in docs/build/html.
🧑💻 Author
Peter Cullen Burbery
This utility library is part of a broader collection of tools for automation, data processing, and system utility scripting.
⚠️ Disclaimer
This is a development and educational project. All code is provided in good faith and intended for system automation, productivity, and learning purposes.
If you're a rights holder and want attribution changed or material removed, please contact the maintainer.
Maintained with care by Peter Cullen Burbery.
📘 Citation
If you use this module in your work, please cite the following:
Peter Cullen Burbery. (2025). Peter Cullen Burbery Python functions [Software]. Zenodo. https://doi.org/10.5281/zenodo.16727183
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file peter_cullen_burbery_python_functions-1.7.2.tar.gz.
File metadata
- Download URL: peter_cullen_burbery_python_functions-1.7.2.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e22e3c0a4420ab9b2e469ffab92df9c0ca3a4a1afe48c74e9b267d7ae865f9b
|
|
| MD5 |
13defcd5bdd381467ffaec3fced6c999
|
|
| BLAKE2b-256 |
06ccdaf57d8ba201e5f79c1b0c1ab15939afe130793c518427c22a0e16e1de1b
|
Provenance
The following attestation bundles were made for peter_cullen_burbery_python_functions-1.7.2.tar.gz:
Publisher:
python-publish.yml on PeterCullenBurbery/peter-cullen-burbery-python-functions
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
peter_cullen_burbery_python_functions-1.7.2.tar.gz -
Subject digest:
7e22e3c0a4420ab9b2e469ffab92df9c0ca3a4a1afe48c74e9b267d7ae865f9b - Sigstore transparency entry: 348823340
- Sigstore integration time:
-
Permalink:
PeterCullenBurbery/peter-cullen-burbery-python-functions@5d0dcd9eb3fd0af4dc13cf258108b7a12fc7d620 -
Branch / Tag:
refs/tags/v1.7.2 - Owner: https://github.com/PeterCullenBurbery
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@5d0dcd9eb3fd0af4dc13cf258108b7a12fc7d620 -
Trigger Event:
release
-
Statement type:
File details
Details for the file peter_cullen_burbery_python_functions-1.7.2-py3-none-any.whl.
File metadata
- Download URL: peter_cullen_burbery_python_functions-1.7.2-py3-none-any.whl
- Upload date:
- Size: 12.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb4b877cda53342bad43ab9d7eba761f854a6ae159ced3e5ec9a42a37e6dbb8b
|
|
| MD5 |
e43720c001e3791b32501b8b3808377f
|
|
| BLAKE2b-256 |
7e295944d0c3b788d919d434ea2079973310149501e6f051821f0144640c64c4
|
Provenance
The following attestation bundles were made for peter_cullen_burbery_python_functions-1.7.2-py3-none-any.whl:
Publisher:
python-publish.yml on PeterCullenBurbery/peter-cullen-burbery-python-functions
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
peter_cullen_burbery_python_functions-1.7.2-py3-none-any.whl -
Subject digest:
eb4b877cda53342bad43ab9d7eba761f854a6ae159ced3e5ec9a42a37e6dbb8b - Sigstore transparency entry: 348823347
- Sigstore integration time:
-
Permalink:
PeterCullenBurbery/peter-cullen-burbery-python-functions@5d0dcd9eb3fd0af4dc13cf258108b7a12fc7d620 -
Branch / Tag:
refs/tags/v1.7.2 - Owner: https://github.com/PeterCullenBurbery
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@5d0dcd9eb3fd0af4dc13cf258108b7a12fc7d620 -
Trigger Event:
release
-
Statement type: