objprint
A library that can print Python objects in human readable format
What it is and what it does
objprint is a debugging and inspection library that replaces Python's standard print with a function that formats objects in a readable, structured way. It shows object attributes with their values, handles nested objects, and can display method signatures. The library works on Python 3.9 through 3.13 and has no external runtime dependencies, making it lightweight to add to any project.
Beyond basic printing, objprint offers several modes: it can serialize objects to JSON-compatible format, filter which attributes to display, register custom formatters for specific types, add a __str__ method to classes via a decorator, and retrieve the string representation without printing. You can also enable or disable printing globally or per-call, add execution context (file, line number, function name), and print argument expressions inline.
Use it for:
- Debug complex object state during development by printing nested class instances with all their attributes visible
- Add structured __str__ methods to custom classes using the @add_objprint decorator for cleaner repr output
- Serialize Python objects to JSON format for logging or API responses using objjson
- Inline object inspection in function calls by wrapping arguments with op() to see their values without extra variables
- Filter object output to show only specific attributes using include/exclude patterns or regex matching
- Register custom formatters for domain types (e.g., hex for integers, rounded floats) to standardize debug output
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
objprint provides functions to print Python objects in human-readable format, with support for custom formatting, filtering attributes, and JSON serialization.
Yes. objprint is a low-friction debugging tool with no dependencies, permissive licensing, and broad Python version support (3.9–3.13). It solves a real problem—making object inspection readable during development—and the fact that it returns the object it prints allows inline use. The package is aging but actively maintained, with no known vulnerabilities. Install it if you debug Python objects frequently.
Install
objprint on PyPI
pip
pip install objprintuv
uv add objprintpoetry
poetry add objprintInstalling objprint
Before you install
Installation is straightforward with no runtime dependencies. The package is in Beta status and has aged since its last release, though the repository remains active with recent commits.
License in practice
Licensed under Apache License 2.0 (permissive), allowing free use, modification, and distribution with minimal restrictions—suitable for both open-source and proprietary projects.
Quickstart
pip install objprint
from objprint import op
class Player:
def __init__(self):
self.name = "Alice"
self.age = 18
op(Player())
Verify before relying
- Performance characteristics when printing very large or deeply nested object graphs
- Compatibility with dataclasses, NamedTuple, and other special Python types beyond standard classes
Package facts
| License | Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | aging — 643 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,232,882/month — #4,181 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: objprint-0.3.0-py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
astprettyPretty-print Python abstract syntax trees (AST)…
permissive · top 15,000 on PyPI
compact-jsonFormats JSON into compact, human-readable…
permissive · top 5,000 on PyPI
icecreamIceCream provides a drop-in replacement for…
permissive · top 5,000 on PyPI
xmlformatterFormats and compresses XML documents by…
permissive · top 15,000 on PyPI
stringparserExtracts values from strings using…
permissive · top 15,000 on PyPI
dprint-pydprint-py is a Python wrapper for dprint, a…
permissive · top 15,000 on PyPI
singleton-decoratorProvides a decorator that enforces singleton…
copyleft · top 15,000 on PyPI
cssbeautifierBeautifies, unpacks, and deobfuscates CSS code…
permissive · top 5,000 on PyPI
pytest-printAdds fixtures to pytest that print messages…
permissive · top 15,000 on PyPI
prettyprinterSyntax-highlighted, declarative pretty printer…
permissive · top 5,000 on PyPI