lightpanda-io / lightpanda-io/lightpanda-python
Make the generated methods self-documenting: return shapes and the Session conventions
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2
- Forks
- 0
- Avg merge
- 5m
- Merged PRs (30d)
- 9
Description
The docs site now publishes the Python reference generated from this repository's main branch (https://lightpanda.io/docs/reference/python-api, built by the docs repo's python-reference workflow), and the hand-written reference page is being retired. Two pieces of information that page carried cannot be derived from the package today:
-
Return shapes. Every generated method in
lightpanda/_methods.pyis annotated-> Any, so the reference cannot say whether a call returns text, parsed JSON (dict/list), orbytes. The retired page had a Returns column for this. Options: havescripts/generate_methods.pyemit narrower annotations where the tool schema makes the shape known, or state the return shape in the docstrings taken from the tool descriptions. -
Session conventions. Keyword-only arguments, snake_case names derived from the browser's action names, the
selector/backend_node_idpair where one is required andselectorwins,Session.callas the escape hatch with the browser's own names, andToolErroron failure. This is currently a fixed paragraph in the docs generator; it belongs in theSessionclass docstring so it also shows up in IDE hover text and stays next to the code it describes.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read scripts/generate_methods.py and the generated lightpanda/_methods.py, then locate the Session class and inspect how the docs generator currently adds its conventions paragraph. Determine how the tool schema exposes return shapes and document the Session conventions in the class docstring; done means the generated reference and IDE hover text contain both pieces of information.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- documentation, tooling
- Issue type
- Documentation
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100