Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
- CONTRIBUTING.md with contribution guidelines
- CODE_OF_CONDUCT.md following Contributor Covenant
- SECURITY.md with security policy
- This CHANGELOG.md file

## [0.5.0] - 2023

### Added
- I/O Mode: New `cdp.connection` module with WebSocket I/O support
- WebSocket management with async context managers
- JSON-RPC message framing
- Command multiplexing
- Event handling with async iterators
- Comprehensive error handling with typed exceptions

### Changed
- Enhanced documentation with I/O mode examples
- Updated README with usage for both Sans-I/O and I/O modes

## [0.4.x and earlier]

### Features
- Sans-I/O mode with type wrappers for Chrome DevTools Protocol
- Auto-generated Python bindings from CDP specification
- Type hints for all CDP commands, events, and types
- Support for all CDP domains
- Documentation on ReadTheDocs
- Example scripts demonstrating CDP usage

---

For a complete list of changes, see the [commit history](https://github.com/HyperionGray/python-chrome-devtools-protocol/commits/master).

[Unreleased]: https://github.com/HyperionGray/python-chrome-devtools-protocol/compare/v0.5.0...HEAD
[0.5.0]: https://github.com/HyperionGray/python-chrome-devtools-protocol/releases/tag/v0.5.0
128 changes: 128 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at the project's
GitHub repository by opening an issue. All complaints will be reviewed and
investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
108 changes: 108 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Contributing to PyCDP

Thank you for your interest in contributing to Python Chrome DevTools Protocol (PyCDP)! This document provides guidelines for contributing to the project.

## Code of Conduct

By participating in this project, you agree to abide by our Code of Conduct (see [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md)).

## How to Contribute

### Reporting Bugs

If you find a bug, please open an issue on GitHub with:
- A clear description of the problem
- Steps to reproduce the issue
- Expected vs. actual behavior
- Your environment (OS, Python version, etc.)

### Suggesting Enhancements

Enhancement suggestions are welcome! Please open an issue describing:
- The enhancement you'd like to see
- Why it would be useful
- Any implementation ideas you have

### Pull Requests

1. **Fork the repository** and create your branch from `master`
2. **Install development dependencies**:
```bash
pip install poetry
poetry install
```
3. **Make your changes** following the project's coding standards
4. **Run tests** to ensure nothing is broken:
```bash
poetry run make
```
5. **Update documentation** if needed
6. **Commit your changes** with clear, descriptive commit messages
7. **Push to your fork** and submit a pull request

## Development Setup

### Prerequisites

- Python 3.7 or higher
- Poetry for dependency management

### Installation

```bash
# Clone the repository
git clone https://github.com/HyperionGray/python-chrome-devtools-protocol.git
cd python-chrome-devtools-protocol

# Install dependencies
poetry install
```

### Running Tests

```bash
# Run all tests
poetry run make

# Run specific test suites
poetry run pytest test/
poetry run pytest generator/

# Run type checking
poetry run mypy cdp/
poetry run mypy generator/
```

### Code Generation

This project generates Python code from the Chrome DevTools Protocol specification:

```bash
poetry run python generator/generate.py
```

The generated code is checked into version control. If you modify the generator, run it and include the updated generated files in your PR.

## Coding Standards

- Follow [PEP 8](https://www.python.org/dev/peps/pep-0008/) style guidelines
- Use type hints for all functions and methods
- Write docstrings for public APIs
- Ensure code passes `mypy` type checking
- Keep code coverage high

## Project Structure

- `cdp/` - Generated CDP protocol bindings
- `generator/` - Code generator for CDP bindings
- `test/` - Test suite
- `docs/` - Documentation source files
- `examples/` - Example usage scripts

## Questions?

If you have questions about contributing, feel free to open an issue or reach out to the maintainers.

## License

By contributing to PyCDP, you agree that your contributions will be licensed under the MIT License.
1 change: 1 addition & 0 deletions LICENSE.md
41 changes: 37 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ See the [examples directory](examples/) for more usage patterns.

For users who prefer to manage their own I/O:

## Sans-I/O Mode (Original)

For users who prefer to manage their own I/O:

```python
from cdp import page

Expand All @@ -92,4 +88,41 @@ assert repr(frame_id) == "FrameId('my id')"

For more information, see the [complete documentation](https://py-cdp.readthedocs.io).

## API Reference

The library provides Python wrappers for all Chrome DevTools Protocol domains:

- **Page**: Page control (navigation, screenshots, etc.)
- **DOM**: DOM inspection and manipulation
- **Network**: Network monitoring and interception
- **Runtime**: JavaScript execution and evaluation
- **Debugger**: JavaScript debugging
- **Performance**: Performance metrics and profiling
- **Security**: Security-related information
- And many more...

For complete API documentation, visit [py-cdp.readthedocs.io](https://py-cdp.readthedocs.io).

### Type System

All CDP types, commands, and events are fully typed with Python type hints, providing:
- IDE autocomplete support
- Static type checking with mypy
- Clear API contracts
- Inline documentation

## Contributing

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details on:
- How to report bugs and request features
- Development setup and workflow
- Coding standards and testing requirements
- Pull request process

For questions or discussions, feel free to open an issue on GitHub.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

<a href="https://www.hyperiongray.com/?pk_campaign=github&pk_kwd=pycdp"><img alt="define hyperion gray" width="500px" src="https://hyperiongray.s3.amazonaws.com/define-hg.svg"></a>
Loading