skillfed

objprint

A library that can print Python objects in human readable format

objprint v0.3.0 1.2M downloads/30d#4,181 on PyPI713
Permissive 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) AGING released

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 objprint

uv

uv add objprint

poetry

poetry add objprint

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9

Tags

pretty print python objectsdebug object inspectionhuman readable object outputpython object formatterinspect class instancesobject to string conversiondebugging tool for objects
debuggingobject-inspectionpretty-printing

More Software Development packages