Contributing to TradingView Scraper
We welcome contributions from the community! This guide will help you get started with contributing to the TradingView Scraper project.
๐ Ways to Contribute
Code Contributions
- Bug Fixes: Fix issues reported in the issue tracker
- New Features: Implement new scraping modules or enhance existing ones
- Performance Improvements: Optimize code for better performance
- Documentation: Improve documentation, add examples, or fix typos
Non-Code Contributions
- Bug Reports: Report bugs with detailed information
- Feature Requests: Suggest new features or improvements
- Documentation: Help improve or translate documentation
- Testing: Test the library and report issues
๐ ๏ธ Development Setup
Prerequisites
- Python 3.11 or higher
- Git
- uv (for dependency management)
Local Development
-
Fork and Clone the Repository
-
Set up Development Environment
-
Run Tests
-
Build Documentation
๐งช Testing
Writing Tests
- Write tests for all new features
- Include both positive and negative test cases
- Use descriptive test names
- Mock external API calls when possible
Test Structure
import pytest
from tradingview_scraper.symbols.indicators import Indicators
class TestIndicators:
def test_scrape_valid_indicators(self):
"""Test scraping with valid indicators."""
scraper = Indicators()
result = scraper.scrape(
exchange="BINANCE",
symbol="BTCUSD",
indicators=["RSI"]
)
assert result["status"] == "success"
assert "RSI" in result["data"]
def test_scrape_invalid_exchange(self):
"""Test error handling for invalid exchange."""
scraper = Indicators()
result = scraper.scrape(
exchange="INVALID",
symbol="BTCUSD",
indicators=["RSI"]
)
assert result["status"] == "failed"
๐ Pull Request Process
-
Create a Feature Branch
-
Make Your Changes
- Write clean, well-documented code
- Add tests for new functionality
-
Update documentation if needed
-
Run Quality Checks
-
Commit Your Changes
-
Push and Create Pull Request
Then create a pull request on GitHub.
Pull Request Guidelines
- Provide a clear description of the changes
- Reference any related issues
- Include screenshots for UI changes
- Ensure all tests pass
- Update documentation if needed
๐ Reporting Bugs
Bug Report Template
When reporting bugs, please include:
- Description: Clear description of the bug
- Steps to Reproduce:
- Expected Behavior: What should happen
- Actual Behavior: What actually happens
- Environment:
- Python version: 3.11
- OS: Windows 11
- Library version: 1.0.0
Example Bug Report
**Bug: Indicators scraper fails with timeout**
**Steps to reproduce:**
```python
from tradingview_scraper.symbols.indicators import Indicators
scraper = Indicators()
result = scraper.scrape(
exchange="BINANCE",
symbol="BTCUSD",
indicators=["RSI", "MACD"]
)
Expected: Should return indicator data Actual: Times out with error Environment: Python 3.11, Windows 11 ```
๐ก Feature Requests
Feature Request Template
- Title: Clear, descriptive title
- Description: Detailed description of the proposed feature
- Use Case: Explain why this feature would be useful
- Implementation Ideas: Optional suggestions for implementation
๐ Getting Help
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Full Documentation
๐ Code of Conduct
This project follows a code of conduct to ensure a welcoming environment for all contributors. By participating, you agree to:
- Be respectful and inclusive
- Focus on constructive feedback
- Accept responsibility for mistakes
- Show empathy towards other contributors
- Help create a positive community
๐ Acknowledgments
Thank you to all contributors who help make TradingView Scraper better! Your time and effort are greatly appreciated.
This contributing guide is adapted from open-source best practices and can be improved. Feel free to suggest changes!