structlog-pretty
A collection of structlog processors for prettier output
What it is and what it does
structlog-pretty is a collection of processors that integrate with structlog to make structured log output more human-readable. It provides syntax highlighting for code snippets in logs, prettification for JSON and XML fields, multiline string formatting, and numeric rounding for cleaner output. The package wraps around structlog's processor pipeline, so you add its processors to your logging configuration and it transforms specific fields in your log events on the fly.
The package is designed for developers who use structlog and want logs that are easier to read during development or debugging without changing the underlying structured format. It has low install friction—just pygments as a runtime dependency—and comes with optional faster processors if you install the [fast] extra, though those require C compilation and libxml.
Use it for:
- Format JSON request/response payloads in logs for readability during API debugging.
- Highlight code snippets embedded in log messages with syntax coloring.
- Pretty-print XML responses in SOAP or other XML-based service logs.
- Round numeric timing values to a fixed number of digits for cleaner performance logs.
- Display multiline strings (stack traces, formatted output) without mangling indentation.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds structlog processors that format log output with syntax highlighting, JSON/XML prettification, multiline string handling, and numeric rounding for more readable structured logs.
Yes, if you use structlog and want prettier logs without extra dependencies beyond pygments. The dormant maintenance status is not a blocker—the package is stable and focused—but verify compatibility with your structlog and Python versions before adopting. No known security vulnerabilities.
Install
structlog-pretty on PyPI
pip
pip install structlog-prettyuv
uv add structlog-prettypoetry
poetry add structlog-prettyInstalling structlog-pretty
Before you install
Low friction install with a single runtime dependency (pygments). Maintenance is dormant—last commit was 2024-07-15 and no updates in 760 days—but the repository remains active and unarchived, suggesting the package is stable rather than abandoned.
License in practice
Licensed under MIT (permissive), so you can use it freely in commercial and private projects with minimal restrictions.
Quickstart
pip install structlog-pretty
import structlog
import structlog_pretty
structlog.configure(
processors=[
structlog_pretty.SyntaxHighlighter({'request': 'json'}),
structlog_pretty.MultilinePrinter(['request']),
]
)
Requires Python 3; optional C extensions for faster processors need libxml installed.
Verify before relying
- Whether the package works with recent structlog versions and modern Python 3.x releases.
- Performance characteristics of the optional [fast] extras and whether libxml availability is common in typical deployment environments.
Package facts
| License | not declared (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — pygments |
| Maintenance | dormant — 760 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 109,287/month — #12,522 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: structlog_pretty-0.4.3-py3-none-any.whl
Tags
More Text Processing packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyparsingpyparsing provides a library for building text…
permissive · top 1,000 on PyPI
docutilsDocutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
RapidFuzzRapidFuzz provides fast fuzzy string matching…
permissive · top 1,000 on PyPI
tinycss2tinycss2 parses CSS strings into token and…
permissive · top 1,000 on PyPI
llama-parseLlamaParse parses complex documents (PDFs,…
permissive · top 1,000 on PyPI
structlog-gcpConfigures structlog to output logs in Google…
unclear · top 15,000 on PyPI
structlog-sentryBridges structlog and Sentry to automatically…
permissive · top 5,000 on PyPI
structlogstructlog is a structured logging library that…
permissive · top 1,000 on PyPI
pytest-structlogProvides a pytest fixture for capturing and…
permissive · top 15,000 on PyPI
prettyprinterSyntax-highlighted, declarative pretty printer…
permissive · top 5,000 on PyPI
django-structlogIntegrates structured logging into Django…
permissive · top 5,000 on PyPI
macwinnie-enhanced-loggingProvides a batteries-included logging setup…
unclear · top 15,000 on PyPI
opentelemetry-instrumentation-structlogIntegrates structlog logging with OpenTelemetry…
permissive · top 15,000 on PyPI
python-json-loggerFormats Python logging output as JSON, making…
permissive · top 1,000 on PyPI
gdbmongoGdbmongo provides GDB pretty printers and…
permissive · top 5,000 on PyPI