python-api

Look up installed Python package APIs via inspect, pydoc, LSP, and versioned docs, then cache findings.

Updated Aug 28, 2026
One-click install
npx skills add https://github.com/Yash-Awasthi/adapfit --skill python-api-yash-awasthi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: python-api
Source: https://github.com/Yash-Awasthi/adapfit/tree/main/.agents/skills/python-api
Command: npx skills add https://github.com/Yash-Awasthi/adapfit --skill python-api-yash-awasthi

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? AI agents often write Python code from training-data memory, which breaks when the installed library version has renamed, re-signatured, or deprecated a symbol. This Skill enforces verified API lookups against the actually installed version and caches the results so the discovery work is never repeated. ## Core Features & Use Cases - Four lookup shapes by question type: cache hit first, then inspect.signature + pydoc.render_doc symbol cards, dir/pkgutil module surface dumps, LSP hover via Pyright, and WebSearch/WebFetch of version-pinned narrative docs. - Version-keyed cache: every finding lands in scratch/api/<lib>/<version>/<topic>.md with a source line, verbatim extracts, and an agent-synthesized Usage section (Call / Don't call / Trap / Returns). - Named version traps: ships a list of real renames and signature changes (e.g. skrub tabular_learner → tabular_pipeline, skore Project.get by id not key) so known footguns are caught before they bite. - Use Case: Before writing skore.evaluate(learner, data={...}) in an ML experiment script, the agent resolves the installed skore version, checks the cache, runs a probe if needed, and records the confirmed signature — never guessing from memory. ## Quick Start Ask the agent to look up the signature of a function in the installed version of a Python package and cache the result before writing any code that calls it.

Frequently Asked Questions about python-api

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check a Python function signature against the installed version?▼

Resolve the package version with `import pkg; print(pkg.__version__)`, then run `inspect.signature` and `pydoc.render_doc` on the symbol from a scratch script. This Skill wraps that flow and caches the result under scratch/api/<lib>/<version>/ so it is never repeated.

How to look up what a Python module contains programmatically?▼

Use `dir(module)` for the top-level surface and `pkgutil.iter_modules(module.__path__)` for submodules. The Skill's Shape 2 probe dumps both into a versioned surface.md cache file in one execution.

Why does code written from memory fail with ImportError or TypeError?▼

Libraries rename and re-signature symbols between versions — for example skrub renamed `tabular_learner` to `tabular_pipeline` in 0.7 and dropped the positional argument of `mark_as_y` in 0.9. Always confirm against the installed version before writing the call.

Can I use Pyright LSP hover instead of running Python for signature lookups?▼

Yes, when pyrightconfig.json points at the correct environment and the LSP was started after the config existed. The Skill defines a Step 0 availability probe; if hover returns Unknown for installed packages, fall back to pydoc-based lookups for the rest of the session.

When should I fetch versioned documentation instead of using inspect?▼

Use narrative doc fetching when the question depends on a condition, such as what a function returns for a specific argument value, or when comparing two approaches. Always fetch URLs pinned to the installed version and cache verbatim extracts, never /latest/ or /stable/ links.