wat: Inspect Python Objects at Runtime

wat: Inspect Python Objects at Runtime

Summary

wat is a Python inspection tool for exploring unfamiliar objects in a console or debugger. It displays values, types, attributes, methods, signatures, documentation, and available source code to support debugging and learning.

At a glance

Language
Python
License
MIT
Stars
1.9k
Forks
32
Added to OSRepos
March 29, 2026
Last analyzed
October 4, 2026
View on GitHub

Topics

Click on any tag to explore related repositories

Use at your own risk

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.

Overview

wat is a runtime inspector for Python objects. It helps developers answer “what is this object?” without manually combining introspection calls, especially when exploring unfamiliar libraries, complex values, or Python internals.

Use it interactively in a Python console or debugger, either with its compact wat / object syntax or as a function. It is intended for investigation and debugging, not as a replacement for an IDE debugger or static analysis tool.

Key Features

  • Displays an object's formatted value, type, and parent types.
  • Lists variables and methods, with signatures and documentation where available.
  • Can show source code for functions, methods, and classes when available.
  • Offers modifiers to shorten output, reveal dunder or private attributes, and control documentation and formatting.
  • Inspects local and global variables through wat.locals and wat.globals.
  • Provides multiple calling styles, including division syntax, function calls, and piping.
  • Installs without external dependencies, or can be loaded in a session using the documented Insta-Load snippet.

Use Cases

  • A Python developer debugging an unfamiliar return value can quickly identify its type and inspect its attributes.
  • Someone learning a library can review a function's signature and documentation from an interactive console.
  • A developer stopped at a debugger breakpoint can inspect local objects without leaving the session.
  • A Python learner exploring built-ins or complex collections can examine their types, structure, and available methods.

Project Facts

  • Language: Python
  • License: MIT
  • Stars: 1.9k
  • Forks: 32
  • Topics: inspector, python, python-inspect
  • Archived: No

Getting Started

Install the package and import it:

pip install wat
import wat
wat / some_object

See the README for modifiers, examples, and alternative loading methods. Documentation is also available at igrek51.github.io/wat.

Considerations

  • Inspection is performed at runtime, so the object must be available in the current Python process.
  • Source code and documentation may not be available for every object.
  • The README's Insta-Load option executes decoded Python code. Review the extracted code before running it, as the project itself recommends.
  • The repository reports no external package dependencies; the tool is aimed at interactive inspection rather than automated analysis.

Source repository

Open the original repository on GitHub.

11 counted GitHub visits

View on GitHub

Related repositories

Similar repositories that may be relevant next.

OS
OSRepos

Analysis and discovery of open source repositories. Find interesting projects and follow their updates.

Monitor your website with YourWebsiteScore

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of third-party repository code is at your own risk. Always review source code, dependencies, licenses, and security implications before running anything.

© 2025 OSRepos. Built with Nuxt 3 and lots of ❤️