--- id: objprint version: "0.3.0" 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) license_treatment: permissive maintenance: aging --- # objprint — A library that can print Python objects in human readable format License: permissive · Maintenance: aging · Downloads: 1.2M/mo ## 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 above — 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 pip install objprint uv add objprint 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_current - Install friction: low - Maintenance: aging - Downloads: 1.2M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags pretty print python objects, debug object inspection, human readable object output, python object formatter, inspect class instances, object to string conversion, debugging tool for objects, debugging, object-inspection, pretty-printing [View on SkillFed](https://skillfed.io/packages/objprint) · [View on PyPI](https://pypi.org/project/objprint/)