qmetrics.net

MonkeyType

Python runtime-driven static type annotation generator

MonkeyType records runtime types for function arguments and returns, then generates stub files or applies draft annotations to your Python code.

Overview

MonkeyType is a Python library that collects the types of function arguments, return values, and generator yields while your code runs. It uses Python’s profiling hooks to record call traces, stores them in a local SQLite database by default, and lets you turn that data into type information for your modules.

A typical workflow runs your script under MonkeyType, then generates stubs or rewrites source with suggested annotations. Stubs can be reviewed before merge; a direct apply command patches modules in place. Output uses standard Python 3 type syntax and relies on libcst when modifying source files.

Annotations reflect types seen at runtime, so they may be narrower than a hand-written interface would be. The project positions generated types as a first draft for developers to refine before type checking with tools such as mypy. It requires a supported Python release and installs via pip with the libcst dependency.

The companion monkeytype CLI supports run, stub, and apply subcommands so teams can adopt gradual typing without writing every annotation manually.

Key features

  • Runtime collection of argument and return types
  • SQLite-backed call trace storage
  • Stub generation per module
  • Optional in-place annotation apply
  • libcst-based source rewriting
  • CLI run, stub, and apply commands
  • Generator yield type capture
  • Python 3 type annotation output

Use cases

  • Bootstrapping types on untyped codebases
  • Drafting stubs before manual review
  • Profiling one script to type one module
  • Gradual typing alongside mypy
  • Recording real call patterns for APIs

Similar software

Prettier

Opinionated multi-language code formatter

Prettier enforces consistent style by parsing code and reprinting it with fixed rules and line wrapping. It supports many web and data languages.

  • AST-based consistent reprinting
  • Wide language and plugin support
  • Editor and CI integration
JavaScriptDetails →
★ 52.5k⟳ yesterdayMIT

Oxc

Rust-based JavaScript and TypeScript compiler toolkit

Oxc bundles a parser, linter, formatter, transformer, resolver, and minifier for JavaScript and TypeScript. Oxlint and Oxfmt run via npx for everyday lint and format tasks.

  • Oxlint ESLint-compatible linter
  • Oxfmt Prettier-compatible formatter
  • JavaScript and TypeScript parser
RustLinux, macOSDetails →
★ 23.8k⟳ todayMIT

PHP Parser

PHP library for parsing and manipulating PHP ASTs

A PHP package that parses PHP source into an abstract syntax tree for analysis and code transformation. It targets static analysis and programmatic rewriting workflows.

  • PHP 7 and 8 AST parsing
  • Partial parse on invalid code
  • AST dump and pretty-print
PHPDetails →
★ 17.5k⟳ 5 days agoBSD-3-Clause

typescript-eslint

ESLint tooling for linting TypeScript codebases

typescript-eslint connects ESLint to TypeScript syntax and ships parser services plus lint rules. It enables standard and type-aware linting for JavaScript and TypeScript projects.

  • TypeScript parser for ESLint
  • Parser services for other tools
  • Large standard rule catalog
TypeScriptDetails →
★ 16.5k⟳ todayMIT

laravel-ide-helper

Laravel IDE helper and PHPDoc generator package

A Composer package for Laravel apps that builds helper files and PHPDoc so IDEs can autocomplete facades, models, fluent APIs, and container bindings from your project source.

  • Facade PHPDoc via ide-helper:generate
  • Model property docs from database schema
  • PhpStorm meta for container bindings
PHPDetails →
★ 15k⟳ 1 month agoMIT

quicktype

Type and serializer generator from JSON, Schema, and GraphQL

Quicktype infers strongly typed models and serializers from JSON samples, JSON Schema, TypeScript, or GraphQL. Output targets many programming languages via the web app, CLI, or JavaScript API.

  • JSON and JSON Schema inputs
  • GraphQL and TypeScript sources
  • Twenty-five plus target languages
TypeScriptWeb, macOS, Windows, CLIDetails →
★ 13.9k⟳ 2 months agoApache-2.0