Shared Python utilities for Penguin Tech applications
Project description
Penguin Tech Python Utilities
Shared Python utilities for Penguin Tech applications.
Installation
pip install penguin-utils
# With Flask extras
pip install penguin-utils[flask]
Usage
Sanitized Logging
from penguintechinc_utils import get_logger, sanitize_log_data
from penguintechinc_utils.logging import SanitizedLogger
# Simple logger
log = SanitizedLogger("MyComponent")
# Automatically sanitizes sensitive data
log.info("User login attempt", {
"email": "user@example.com", # Logs as: [email]@example.com
"password": "secret123", # Logs as: [REDACTED]
"remember_me": True, # Logs as-is
})
# Output: [MyComponent] INFO: User login attempt {'email': '[email]@example.com', 'password': '[REDACTED]', 'remember_me': True}
Sanitization Rules
The following are automatically redacted:
- Passwords, secrets, tokens
- API keys, auth tokens
- MFA/TOTP codes
- Session IDs, cookies
- Full email addresses (only domain is logged)
Development
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Format code
black src tests
ruff check src tests
# Type check
mypy src
License
AGPL-3.0 - See LICENSE for details.
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 penguin_utils-0.1.0.tar.gz.
File metadata
- Download URL: penguin_utils-0.1.0.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
885da3f3ffb50bb9130def5b871e52420b7ad4b285e3b1c1bd85c4d259a08b1e
|
|
| MD5 |
186d65c245c70a711697c2c83a629b75
|
|
| BLAKE2b-256 |
0dde73a16f786c5ed1339fb97bd925ac46caca0abbb6b84b86ccade84b29eabd
|
Provenance
The following attestation bundles were made for penguin_utils-0.1.0.tar.gz:
Publisher:
publish.yml on penguintechinc/penguin-libs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
penguin_utils-0.1.0.tar.gz -
Subject digest:
885da3f3ffb50bb9130def5b871e52420b7ad4b285e3b1c1bd85c4d259a08b1e - Sigstore transparency entry: 942218554
- Sigstore integration time:
-
Permalink:
penguintechinc/penguin-libs@c9a052ab806abf7593b59ddc7a4ec5363be5cd2a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/penguintechinc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c9a052ab806abf7593b59ddc7a4ec5363be5cd2a -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file penguin_utils-0.1.0-py3-none-any.whl.
File metadata
- Download URL: penguin_utils-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e66b54b1fbb0a87d91bdff5465d2e616ffb6c26be925f321f99215eb74e5d4aa
|
|
| MD5 |
08d56e2e8a9800238b61a7d458b63a66
|
|
| BLAKE2b-256 |
ffd5e85e4cd98b3201d3ef7ee47f1255a0a2f8a95cff72c3b16186833f2c1d25
|
Provenance
The following attestation bundles were made for penguin_utils-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on penguintechinc/penguin-libs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
penguin_utils-0.1.0-py3-none-any.whl -
Subject digest:
e66b54b1fbb0a87d91bdff5465d2e616ffb6c26be925f321f99215eb74e5d4aa - Sigstore transparency entry: 942218563
- Sigstore integration time:
-
Permalink:
penguintechinc/penguin-libs@c9a052ab806abf7593b59ddc7a4ec5363be5cd2a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/penguintechinc
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c9a052ab806abf7593b59ddc7a4ec5363be5cd2a -
Trigger Event:
workflow_dispatch
-
Statement type: