penguin-utils
Sanitized structured logging for Python microservices. Automatically redacts PII (passwords, tokens, emails) before writing to any output sink. Supports stdout, file, syslog, AWS CloudWatch, GCP Cloud Logging, and Apache Kafka.
Installation
pip install penguin-utils
# Optional cloud backends:
pip install penguin-utils[cloudwatch] # AWS CloudWatch Logs
pip install penguin-utils[gcp] # Google Cloud Logging
pip install penguin-utils[kafka] # Apache Kafka
Quick Start
from penguintechinc_utils import SanitizedLogger
from penguintechinc_utils.sinks import StdoutSink
logger = SanitizedLogger("MyComponent", sinks=[StdoutSink()])
logger.info("User login attempt", {
"email": "user@example.com", # Logged as: [email]@example.com
"password": "secret123", # Logged as: [REDACTED]
"remember_me": True, # Logged as-is
})
Auto-Configure from Environment
from penguintechinc_utils.logging import configure_logging_from_env
from penguintechinc_utils import SanitizedLogger
logger = SanitizedLogger("MyApp", sinks=configure_logging_from_env())
Dynamic Decorator Builder
Eliminates traditional 3-tier function boilerplate for Python decorators.
from penguintechinc_utils import add_decorator
@add_decorator(name="my-cool-decorator")
def my_cool_decorator(ctx):
print(f"Calling {ctx.func.__name__} with decorator args: {ctx.dec_kwargs}")
ctx.execution_time = 0
return ctx.proceed()
# Use with or without parameters on sync or async functions:
@my_cool_decorator(tag="v1")
def process_data(item):
return item.upper()
📚 Full documentation: docs/penguin-utils/
- README — complete feature overview and all sinks
- API Reference — all classes and methods
- Changelog
- Migration Guide — upgrading to 0.2.x cloud sinks
License
MIT — See LICENSE for details.
Metadata
Release files for penguin-utils 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| penguin_utils-0.3.0.tar.gz | 19.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| penguin_utils-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.9 kB
Release files / penguin_utils-0.3.0.tar.gz
| Download URL | penguin_utils-0.3.0.tar.gz |
|---|---|
| Size | 19.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c24cf3ddbafa61c61a6d7ceeb797c5698313ea7d6020e019aa1f6df842b2ae41
|
|
BLAKE2b-256 checksum How to use checksums |
ff0f726aeb01b43dc88ac43da9bd00fff5dc1cffd90980bddb85ad809fec71b5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 11, 2026.
Transparency logRelease files / penguin_utils-0.3.0-py3-none-any.whl
| Download URL | penguin_utils-0.3.0-py3-none-any.whl |
|---|---|
| Size | 14.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
18f176a6d23e882a7b97309cad37cc0fc34314c525ac424e1c38e2509aa68bb0
|
|
BLAKE2b-256 checksum How to use checksums |
72f5b4f202307643f2d2492600b7e0afb04e22eaf13e097aa5f1e40b2a518664
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 11, 2026.
Transparency log