Skip to content

0.4.0

Choose a tag to compare

@arrufat arrufat released this 31 Aug 18:57
· 93 commits to main since this release

First PyPI release of the Python client for Lightpanda, a lightweight headless browser. Bundles lightpanda-io/browser 0.4.0: no separate browser download.

pip install lightpanda   # or: uv add lightpanda

What's included

  • Browser / Session: sync API. Browser() spawns the bundled binary in MCP mode and talks JSON-RPC over local HTTP; new_session() returns a Session that exposes every browser tool as a typed, documented method (goto, extract, markdown, tree, click, fill, wait_for_selector, evaluate, screenshot, …). Dict/list arguments such as extract's schema are serialized for you, and JSON results come back as Python values.
  • AsyncBrowser / AsyncSession: asyncio facade over the same API. Starts lazily on async with or first new_session(), runs sessions concurrently on a thread pool (max_concurrency), and AsyncBrowser.wrap(browser) adopts an existing sync Browser. Session and AsyncSession are context managers that close the session on exit.
  • run_script / run_script_async: replay a saved PandaScript agent script (lightpanda agent /save) without any LLM, with an optional env mapping.
  • lightpanda CLI on PATH: the console script execs the bundled binary, so lightpanda agent, lightpanda fetch and lightpanda serve are available after install.
  • Errors: LightpandaError base, with ProtocolError, ToolError and ScriptError.
  • Process safety: the browser subprocess is killed when the interpreter exits (PR_SET_PDEATHSIG on Linux).

Wheels

One py3-none-<platform> wheel per platform, any Python ≥ 3.10:

  • manylinux_2_35_x86_64, manylinux_2_35_aarch64
  • macosx_13_0_x86_64, macosx_14_0_arm64

The client library is Apache-2.0; the bundled browser binary is AGPL-3.0.