Thank you for your interest in contributing to trendspyg! This document provides guidelines and instructions for contributing.
By participating in this project, you agree to maintain a respectful and inclusive environment for all contributors.
If you find a bug, please open an issue with:
- A clear, descriptive title
- Steps to reproduce the issue
- Expected vs actual behavior
- Your environment (Python version, OS)
- Code samples if applicable
Feature requests are welcome! Please open an issue describing:
- The problem you're trying to solve
- Your proposed solution
- Why this would be useful to other users
-
Fork the repository and create a new branch:
git checkout -b feature/your-feature-name
-
Make your changes:
- Write clear, commented code
- Follow existing code style (PEP 8)
- Add type hints to all functions
- Update documentation if needed
-
Add tests:
- All new features must include tests
- Ensure existing tests still pass
- Aim for >80% code coverage on new code
pytest tests/ -v --cov=trendspyg
-
Update documentation:
- Update README.md if adding features
- Add docstrings to new functions
- Update CHANGELOG.md
-
Commit your changes:
- Use clear, descriptive commit messages
- Follow conventional commit format:
feat:for new featuresfix:for bug fixesdocs:for documentationtest:for testsrefactor:for code refactoring
-
Push and create a Pull Request:
git push origin feature/your-feature-name
- Provide a clear PR description
- Link any related issues
- Wait for review and feedback
-
Clone the repository:
git clone https://github.com/flack0x/trendspyg.git cd trendspyg -
Install development dependencies:
pip install -e .[dev,analysis]
-
Run tests:
pytest tests/ -v
-
Run linting:
flake8 trendspyg/ mypy trendspyg/
- Follow PEP 8 guidelines
- Use type hints for all function parameters and returns
- Maximum line length: 100 characters
- Use descriptive variable names
- Add docstrings to all public functions
Example:
def download_google_trends_rss(
geo: str = 'US',
output_format: OutputFormat = 'dict'
) -> Union[List[Dict], str, 'pd.DataFrame']:
"""
Download Google Trends RSS feed data.
Args:
geo: Country/region code (e.g., 'US', 'GB')
output_format: Output format ('dict', 'json', 'csv', 'dataframe')
Returns:
Trend data in requested format
Raises:
InvalidParameterError: If parameters are invalid
"""- Write tests for all new functionality
- Use pytest for testing
- Organize tests by module (test_rss_downloader.py, test_csv_downloader.py)
- Include both positive and negative test cases
- Test edge cases and error handling
Test structure:
class TestFeature:
"""Test feature functionality"""
def test_basic_functionality(self):
"""Test basic feature usage"""
result = my_function()
assert result is not None
def test_error_handling(self):
"""Test error conditions"""
with pytest.raises(InvalidParameterError):
my_function(invalid_param)- Keep README.md up to date
- Add docstrings to all public functions
- Include examples for new features
- Update CHANGELOG.md for all changes
If you have questions about contributing, feel free to:
- Open an issue with the question label
- Reach out via GitHub discussions
Thank you for contributing to trendspyg! 🚀