Python type wrappers and WebSocket client for the Chrome DevTools Protocol, enabling browser automation and debugging.
PyCDP is a Python library that provides type-safe wrappers and a WebSocket client for the Chrome DevTools Protocol (CDP). It enables developers to remotely control and automate web browsers by generating Python classes from the CDP specification, offering autocomplete and static type checking. This solves the problem of manually crafting JSON messages for CDP communication, reducing errors and development time.
Python developers building browser automation tools, testing frameworks, web scrapers, or debugging utilities that require programmatic control of Chrome or Chromium-based browsers.
Developers choose PyCDP because it provides fully typed, auto-generated Python bindings for the entire CDP specification, ensuring IDE autocomplete and type safety. Its dual-mode architecture offers flexibility for custom I/O integration or out-of-the-box WebSocket management, making it more robust than manual JSON handling.
Python type wrappers for Chrome DevTools Protocol (CDP)
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Automatically creates Python classes with full type hints from the CDP spec, enabling IDE autocomplete and catching errors at development time, as emphasized in the README.
Offers Sans-I/O mode for custom async framework integration and I/O mode with built-in WebSocket management, allowing developers to choose based on their I/O needs, as detailed in the 'Two Usage Modes' section.
Provides wrappers for all CDP domains like Page, Network, and Debugger, ensuring full access to browser capabilities without manual JSON handling, as listed in the Key Features.
Designed for async/await patterns with event handling via async iterators in I/O mode, making it suitable for modern Python applications, as highlighted in the README.
Tied to the Chrome DevTools Protocol; updates to CDP may require library changes and potentially introduce breaking compatibility, which isn't addressed in the README's stability guarantees.
Requires an extra installation step for I/O support (pip install chrome-devtools-protocol[io]), adding complexity and dependency management compared to basic usage.
Focuses on low-level CDP commands, so developers must build custom logic for common browser interactions like clicking or typing, unlike frameworks with pre-built actions.