Skip to main content

lightpanda-python

Lightpanda for Python: scrape and automate the web with pip install lightpanda. Browser included, no separate download.

Lightpanda is a lightweight headless browser — an order of magnitude less memory than Chrome stacks. The wheel bundles the browser binary; there is no second install step.

uv add lightpanda        # or: uv pip install lightpanda / pip install lightpanda
from lightpanda import Browser

with Browser() as b:
    page = b.new_session()
    page.goto(url="https://example.com")
    data = page.extract(schema={"title": "h1"})

The same API is available for asyncio — AsyncBrowser spawns the browser on first use and runs sessions concurrently:

from lightpanda import AsyncBrowser

async with AsyncBrowser() as b:
    page = await b.new_session()
    await page.goto(url="https://example.com")
    data = await page.extract(schema={"title": "h1"})

Every browser tool is a Session method (both waitForSelector and wait_for_selector work), typed and documented in your IDE. Replay a saved lightpanda agent script without any LLM:

from lightpanda import run_script

run_script("hn.lp.js", env={"LP_HN_USERNAME": "me"})

(run_script_async is the awaitable variant.)

The package also puts the full lightpanda CLI on PATH (agent REPL, fetch, serve).

License

This client library is Apache-2.0. The bundled Lightpanda browser binary is licensed separately under AGPL-3.0 — see lightpanda-io/browser.

Development

The runtime binary is resolved from LIGHTPANDA_BIN, the package directory, then PATH. For development, clone lightpanda-io/browser as a sibling checkout and build it (zig build) — or point LIGHTPANDA_BIN at any lightpanda binary. Then:

uv run --group dev pytest tests

Regenerate the tool methods (lightpanda/_methods.py) and the API docs:

uv run --no-project python scripts/generate_methods.py
uv run --no-project --with pdoc python scripts/build_docs.py   # writes docs/

Building a wheel

With a binary available (LIGHTPANDA_BIN, or the sibling checkout built ReleaseFast):

uv build --wheel                                    # -> dist/lightpanda-*-py3-none-<plat>.whl
LIGHTPANDA_PLAT=manylinux_2_35_x86_64 uv build --wheel   # CI: tag for the release runner's glibc

The wheel is platform-specific (it carries the binary) but works on every Python ≥3.10 — hence the py3-none-<plat> tag. Release wheels must bundle a ReleaseFast binary; a debug build works but is several times larger and slower.

Releasing

CI (.github/workflows/wheels.yml) builds and tests wheels for all four platforms on every pull request and push to main, bundling the browser's nightly release. To publish: create a GitHub release on this repo whose tag matches the browser release to bundle (e.g. v0.1.0) — CI builds wheels from that browser release, derives the wheel version from the tag, tests on all platforms, and publishes to PyPI via trusted publishing. The manual workflow_dispatch path (any browser tag, publish to TestPyPI or PyPI) remains available for dry runs.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

lightpanda-0.4.0-py3-none-manylinux_2_35_x86_64.whl (48.5 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ x86-64

lightpanda-0.4.0-py3-none-manylinux_2_35_aarch64.whl (48.1 MB view details)

Uploaded Python 3manylinux: glibc 2.35+ ARM64

lightpanda-0.4.0-py3-none-macosx_14_0_arm64.whl (26.1 MB view details)

Uploaded Python 3macOS 14.0+ ARM64

lightpanda-0.4.0-py3-none-macosx_13_0_x86_64.whl (27.7 MB view details)

Uploaded Python 3macOS 13.0+ x86-64

File details

Details for the file lightpanda-0.4.0-py3-none-manylinux_2_35_x86_64.whl.

File metadata

  • Download URL: lightpanda-0.4.0-py3-none-manylinux_2_35_x86_64.whl
  • Upload date:
  • Size: 48.5 MB
  • Tags: Python 3, manylinux: glibc 2.35+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for lightpanda-0.4.0-py3-none-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 3f03c5a5df24b86e74225104d337fea951678bc5b1c9f7d38cc1af7c0cb0fe28
MD5 6d7d9fc775608b2940e1ed1e84a9c422
BLAKE2b-256 dea408a57db045ef831f1290c1bc2d1c33fe742f65d68d41c90e97070c9fb95a

See more details on using hashes here.

File details

Details for the file lightpanda-0.4.0-py3-none-manylinux_2_35_aarch64.whl.

File metadata

  • Download URL: lightpanda-0.4.0-py3-none-manylinux_2_35_aarch64.whl
  • Upload date:
  • Size: 48.1 MB
  • Tags: Python 3, manylinux: glibc 2.35+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for lightpanda-0.4.0-py3-none-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 2d5c9044dc6c47d4023dc411d0f6ab596f1d803c5f107abf14f0a492a2a68207
MD5 15ba14465fb0c07ad6758c197664185c
BLAKE2b-256 03bf4e0e6da72d5c31467c5c2b7be64f37b25759e2ce870a4816f448d4f253c4

See more details on using hashes here.

File details

Details for the file lightpanda-0.4.0-py3-none-macosx_14_0_arm64.whl.

File metadata

  • Download URL: lightpanda-0.4.0-py3-none-macosx_14_0_arm64.whl
  • Upload date:
  • Size: 26.1 MB
  • Tags: Python 3, macOS 14.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for lightpanda-0.4.0-py3-none-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 56b04f70c4ddf9906c544b01bfea02d4fb91e3681829cb152d9051b422bfc66a
MD5 e09bf596b6f1ce543bbb64c3e87e9294
BLAKE2b-256 7aff8d619bd05402a451d4eb4ad3cd9a79452d1fb697f0852650dc2b3149658b

See more details on using hashes here.

File details

Details for the file lightpanda-0.4.0-py3-none-macosx_13_0_x86_64.whl.

File metadata

  • Download URL: lightpanda-0.4.0-py3-none-macosx_13_0_x86_64.whl
  • Upload date:
  • Size: 27.7 MB
  • Tags: Python 3, macOS 13.0+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for lightpanda-0.4.0-py3-none-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 0eda71fab6143978e6563d5ddcddd8d79189cfca9b0552e9f176a2fe167d005a
MD5 d630757b22d01a79cb36f7ea6a546a8a
BLAKE2b-256 992cdd0a45cf8eca6aa12e1940d0a5e38c81873b00d44e1cf148bb558d36f958

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.4.0 This release

4 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page