Skip to content
Merged
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
69 changes: 21 additions & 48 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,64 +9,37 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added
- CONTRIBUTING.md with contribution guidelines
- CHANGELOG.md for tracking version history
- CODE_OF_CONDUCT.md for community standards
- SECURITY.md with security policy and vulnerability reporting
- CODE_OF_CONDUCT.md following Contributor Covenant
- SECURITY.md with security policy
- This CHANGELOG.md file

## [0.5.0]
## [0.5.0] - 2023

### Added
- I/O Mode with built-in WebSocket connection support via `cdp.connection` module
- I/O Mode: New `cdp.connection` module with WebSocket I/O support
- WebSocket management with async context managers
- JSON-RPC message framing and multiplexing
- Event handling via async iterators
- JSON-RPC message framing
- Command multiplexing
- Event handling with async iterators
- Comprehensive error handling with typed exceptions
- Optional websockets dependency via `[io]` extra

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

## [0.4.0]
## [0.4.x and earlier]

### Changed
- Updated to latest Chrome DevTools Protocol specification
- Improved type hints and mypy compliance
- Enhanced documentation

## [0.3.0]

### Added
- Initial Sans-I/O implementation
- Automatic code generation from CDP specification
- Type wrappers for all CDP types, commands, and events
- Comprehensive test suite

### Changed
- Improved project structure
- Enhanced type safety
### 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

## [0.2.0]
---

### Added
- Enhanced type definitions
- Additional protocol domains

### Fixed
- Various type annotation improvements
- Bug fixes in code generation

## [0.1.0]

### Added
- Initial release
- Basic type wrappers for Chrome DevTools Protocol
- Code generator from CDP specification
- MIT License
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/compare/v0.4.0...v0.5.0
[0.4.0]: https://github.com/HyperionGray/python-chrome-devtools-protocol/compare/v0.3.0...v0.4.0
[0.3.0]: https://github.com/HyperionGray/python-chrome-devtools-protocol/compare/v0.2.0...v0.3.0
[0.2.0]: https://github.com/HyperionGray/python-chrome-devtools-protocol/compare/v0.1.0...v0.2.0
[0.1.0]: https://github.com/HyperionGray/python-chrome-devtools-protocol/releases/tag/v0.1.0
[0.5.0]: https://github.com/HyperionGray/python-chrome-devtools-protocol/releases/tag/v0.5.0
5 changes: 3 additions & 2 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ 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 via GitHub issues.
All complaints will be reviewed and investigated promptly and fairly.
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.
Expand Down
162 changes: 66 additions & 96 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,138 +1,108 @@
# Contributing to PyCDP

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

## Getting Started
## Code of Conduct

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

- Python 3.7 or higher
- Poetry for dependency management
- Git for version control
## How to Contribute

### Setting Up Development Environment
### Reporting Bugs

1. Fork and clone the repository:
```bash
git clone https://github.com/YOUR_USERNAME/python-chrome-devtools-protocol.git
cd python-chrome-devtools-protocol
```
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.)

2. Install dependencies:
### 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 Workflow
## Development Setup

### Code Generation
### Prerequisites

- Python 3.7 or higher
- Poetry for dependency management

This project automatically generates Python wrappers from the Chrome DevTools Protocol specification:
### Installation

```bash
poetry run python generator/generate.py
# 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

Run the test suite:
```bash
# Run all tests
poetry run make

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

### Type Checking

We use mypy for static type checking:
```bash
# Run type checking
poetry run mypy cdp/
poetry run mypy generator/
```

### Complete Build
### Code Generation

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

Run all checks (type checking, tests, and generation):
```bash
poetry run make default
poetry run python generator/generate.py
```

## Submitting Changes

### Pull Request Process

1. Create a new branch for your feature or bugfix:
```bash
git checkout -b feature/your-feature-name
```

2. Make your changes and ensure:
- All tests pass
- Code passes type checking
- Code follows the existing style
- Documentation is updated if needed

3. Commit your changes with clear, descriptive messages:
```bash
git commit -m "Add feature: brief description"
```

4. Push to your fork and submit a pull request:
```bash
git push origin feature/your-feature-name
```

5. In your pull request description:
- Describe what changes you made and why
- Reference any related issues
- Include any relevant context

### Code Review

- Maintainers will review your pull request
- Address any feedback or requested changes
- Once approved, a maintainer will merge your PR

## Reporting Issues

### Bug Reports

When reporting bugs, please include:
- A clear, descriptive title
- Steps to reproduce the issue
- Expected behavior vs. actual behavior
- Python version and environment details
- Any relevant error messages or logs
The generated code is checked into version control. If you modify the generator, run it and include the updated generated files in your PR.

### Feature Requests
## Coding Standards

For feature requests, please:
- Clearly describe the feature and its use case
- Explain why it would be valuable
- Provide examples if possible
- 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

## Code Style
## Project Structure

- Follow PEP 8 style guidelines
- Use type hints for function parameters and return values
- Write clear, descriptive variable and function names
- Add docstrings for public APIs
- Keep functions focused and modular
- `cdp/` - Generated CDP protocol bindings
- `generator/` - Code generator for CDP bindings
- `test/` - Test suite
- `docs/` - Documentation source files
- `examples/` - Example usage scripts

## Documentation
## Questions?

- Update README.md if you add new features
- Update docstrings for any modified functions or classes
- Add examples for new functionality when appropriate
If you have questions about contributing, feel free to open an issue or reach out to the maintainers.

## License

By contributing, you agree that your contributions will be licensed under the MIT License.

## Questions?

If you have questions, feel free to:
- Open an issue for discussion
- Reach out to the maintainers

Thank you for contributing to PyCDP!
By contributing to PyCDP, you agree that your contributions will be licensed under the MIT License.
1 change: 1 addition & 0 deletions LICENSE.md
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,41 @@ For information about reporting security vulnerabilities, please see our [Securi

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

## 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
Loading