skillfed

cdp-use

Type safe generator/client library for CDP

cdp-use v1.4.5 11.1M downloads/30d#1,415 on PyPI310
Permissive license MIT Active released

What it is and what it does

CDP Use is a code generator that produces type-safe Python client libraries for the Chrome DevTools Protocol from official protocol specifications. It wraps the raw CDP WebSocket interface with TypedDict-based type hints, event handlers, and domain-specific client classes, so your IDE can autocomplete commands and catch parameter errors before runtime.

You use it by installing the package, connecting an async client to a Chrome DevTools endpoint, and then calling domain-specific methods (like `cdp.send.Page.navigate()` or `cdp.send.Runtime.evaluate()`) with full type safety. Event handlers can be registered with matching type signatures, and the library validates both command parameters and callback signatures at development time. The underlying dependencies—httpx, typing-extensions, and websockets—handle HTTP, type annotations, and WebSocket communication.

Use it for:

  • Automate browser testing with type-checked CDP commands and IDE autocompletion for all available domains.
  • Build browser automation scripts that catch parameter errors at development time instead of runtime failures.
  • Monitor and react to browser events (page navigation, console messages, network requests) with fully typed event handlers.
  • Integrate Chrome DevTools Protocol into Python applications where type safety and IDE support reduce debugging time.
  • Generate and regenerate bindings from the latest protocol specs to stay compatible with new Chrome versions.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Generates type-safe Python bindings for the Chrome DevTools Protocol with full TypeScript-like type hints, enabling IDE autocompletion and compile-time parameter validation for CDP commands and events.

Yes. CDP Use is worth installing if you need to interact with Chrome DevTools Protocol from Python and value type safety and IDE support. Low install friction, active maintenance, permissive MIT license, no known vulnerabilities, and a top-5000 popularity tier indicate a stable, usable package. The main trade-off is the Python 3.11+ requirement and the need for a running Chrome DevTools endpoint.

Install

cdp-use on PyPI

pip

pip install cdp-use

uv

uv add cdp-use

poetry

poetry add cdp-use

Installing cdp-use

Before you install

Low friction install with three lightweight runtime dependencies (httpx, typing-extensions, websockets). Active maintenance with recent commits and steady releases since July 2025.

License in practice

MIT license permits unrestricted use, modification, and distribution in both open-source and commercial projects with minimal obligations.

Quickstart

pip install cdp-use

import asyncio
from cdp_use.client import CDPClient

async def main():
    async with CDPClient("ws://localhost:9222/devtools/browser/...") as cdp:
        targets = await cdp.send.Target.getTargets()
        await cdp.send.Page.navigate({"url": "https://example.com"})

asyncio.run(main())

Requires Python 3.11 or later; Chrome DevTools Protocol endpoint must be running and accessible via WebSocket.

Verify before relying

  • Whether the auto-generated bindings stay synchronized with Chrome protocol updates without manual intervention.
  • Performance overhead of type checking and event registration at runtime compared to untyped alternatives.
  • Compatibility with headless Chrome versions and whether all 50+ CDP domains are fully functional.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.11)
Install friction low — pure-Python wheel
Runtime dependencies 3 — httpx, typing-extensions, websockets
Maintenance actively maintained — 173 days since the last release
Last repo commit
First released
Downloads 11,122,119/month — #1,415 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: cdp_use-1.4.5-py3-none-any.whl

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

chrome devtools protocol python clienttype-safe CDP bindingschrome automation with type hintsdevtools protocol python generatorbrowser automation type checkingCDP event handlers pythonchrome remote debugging protocol
browser-automationtype-safedevtools-protocol

More Software Development packages