poka.sh

Docs

PYI

Generated by scripts/gen-format-pages.py from docs/data/format-metadata/, FILE_FORMATS.csv and docs/formats-master.csv. Do not edit by hand: change the source, then run the script.

Python Stub Preview.

At a glance

Purpose A Python stub file: type signatures for a module, with ... in place of bodies.
Extensions .pyi
Poka parser poka-pyi
Viewer poka-metadata-card-viewer
Depth tier Metadata card (see Depth tiers)
Breadth tier B4 Summary (see Breadth tiers)

How much Poka reads

B4 Summary. The container and metadata are read and summarised (counts, properties, structure), but the main content is not rendered.

Confidence: medium (the reviewer read the code). Basis: Reviewed 2026-10-26: read parsers/poka-pyi/src/main.rs (392 lines) and plugin.json in full. The crate has no unit tests and no tests/samples.rs, and the corpus has colorsys.pyi, shlex.pyi but no test reads them, so the tier rests on reading the code. Covers .pyi. The output is a metadata card of counts found by matching text line by line: classes (with Protocol, NamedTuple, TypedDict and Enum classes counted apart), top-level functions, methods and async methods, @overload, @deprecated and @final, TypeVar, ParamSpec, NewType, type aliases, module constants, imports, and comment and blank lines. Judgement: B4, because the structure is summarised but the source itself is never shown.

What Poka does not read

  • The source text is not shown: the card carries only counts and a few sample names, with no code view or highlighting
  • Constructs are found by matching text line by line, not by parsing, so multi-line declarations, nested or indented definitions and keywords inside strings or comments can be miscounted
  • Counts of named items stop where their name list is capped (imports at 32, classes at 64, functions at 96, typevars at 32, paramspecs at 16, newtypes at 32, type aliases at 32), so a larger file under-reports them
  • Files over 32 MiB are cut to the first 32 MiB (the card says so)
  • Text that is not UTF-8 is decoded with replacement characters; no other encoding is tried
  • Signatures (parameters and return types) are not shown

Libraries

Libraries Poka uses or has assessed for this format, with the status, licence and language the registry records.

  • rustpython-ruff_python_parser (candidate; MIT; Rust; https://docs.rs/rustpython-ruff_python_parser/) — Parses Python source to an AST; unofficial RustPython fork of Ruff's parser; stub-specific handling not documented on the page
  • Ruff (candidate; MIT; Rust; https://github.com/astral-sh/ruff) — Python linter with its own parser; FAQ shows it recognises .pyi files; parser crates are internal to the repo

Sources

  • parsers/poka-pyi/src/main.rs
  • parsers/poka-pyi/plugin.json