Thank you for your interest in contributing to the Vwire IoT Python library! This document provides guidelines and instructions for contributing.
By participating in this project, you agree to maintain a welcoming and inclusive environment for everyone.
- Check if the bug has already been reported in Issues
- If not, create a new issue with:
- Clear, descriptive title
- Steps to reproduce
- Expected vs actual behavior
- Python version and OS
- Relevant code snippets or error messages
- Open an issue with the
enhancementlabel - Describe the feature and its use case
- Explain how it aligns with the Arduino library API (if applicable)
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Run tests:
pytest - Run linting:
black . && flake8 - Commit with clear messages:
git commit -m 'Add amazing feature' - Push to your fork:
git push origin feature/amazing-feature - Open a Pull Request
# Clone your fork
git clone https://github.com/YOUR_USERNAME/vwire-python.git
cd vwire-python
# Create virtual environment
python -m venv venv
source venv/bin/activate # Linux/Mac
venv\Scripts\activate # Windows
# Install development dependencies
pip install -e ".[dev]"- Follow PEP 8
- Use Black for formatting
- Maximum line length: 100 characters
- Use type hints for public APIs
- Write docstrings for all public methods
def virtual_send(self, pin: int, value: Union[str, int, float]) -> bool:
"""
Send a value to a virtual pin.
Matches Arduino library Vwire.virtualSend().
Args:
pin: Virtual pin number (0-255)
value: Value to send (will be converted to string)
Returns:
True if published successfully
Example:
device.virtual_send(0, 25.5)
"""
...# Run all tests
pytest
# Run with coverage
pytest --cov=vwire --cov-report=html
# Run specific test file
pytest tests/test_core.pyThe Python library should mirror the Arduino Vwire library API:
| Arduino | Python |
|---|---|
camelCase methods |
snake_case methods |
Vwire.virtualSend(V0, val) |
device.virtual_send(0, val) |
VWIRE_RECEIVE(V0) handler |
@device.on_virtual_receive(0) decorator |
When adding new features:
- Check if equivalent exists in Arduino library
- Use consistent naming conventions
- Provide both decorator and method-based APIs where appropriate
- Update README.md for user-facing changes
- Add docstrings to all public methods
- Include examples in docstrings
- Update examples/ if API changes
- Update version in
__init__.pyandpyproject.toml - Update CHANGELOG.md
- Create a release PR
- After merge, tag the release
- Build and publish to PyPI
- Open a discussion on GitHub
- Email: support@vwire.io
Thank you for contributing! 🎉