Contributing to BinomoAPI
Contributing to BinomoAPI
Thank you for your interest in contributing to BinomoAPI! This guide will help you get started with contributing to the project.
How to Contribute
1. Setting Up Development Environment
- Fork the repository
- Clone your fork:
git clone https://github.com/your-username/BinomoAPI.git
cd BinomoAPI
- Create a virtual environment:
python -m venv venv
source venv/bin/activate # Unix/macOS
venv\Scripts\activate # Windows
- Install dependencies:
pip install -r requirements.txt
pip install -r requirements-dev.txt2. Making Changes
- Create a new branch:
git checkout -b feature/your-feature-name
- Make your changes
- Run tests:
pytest tests/
- Format code:
black .
isort .
- Run linting:
flake8 .
mypy .3. Submitting Changes
- Commit your changes:
git add .
git commit -m "feat: add new feature"
- Push to your fork:
git push origin feature/your-feature-name
- Create a Pull Request
Coding Standards
Python Code Style
- Follow PEP 8
- Use type hints
- Maximum line length: 88 characters
- Use descriptive variable names
Example Code Style
from typing import Dict, Optional
class TradingClient:
"""
Trading client implementation.
Attributes:
api_key: API authentication key
demo_mode: Whether to use demo account
"""
def __init__(
self,
api_key: str,
demo_mode: bool = True
) -> None:
self.api_key = api_key
self.demo_mode = demo_mode
async def execute_trade(
self,
asset: str,
amount: float,
direction: str
) -> Dict[str, any]:
"""
Execute a trading operation.
Args:
asset: Trading asset name
amount: Trade amount
direction: Trade direction
Returns:
Dict containing trade result
Raises:
TradeError: If trade execution fails
"""
# ImplementationDocumentation Standards
- Use Google-style docstrings
- Document all public APIs
- Include type hints
- Provide usage examples
Testing Standards
- Write unit tests for all new features
- Maintain test coverage above 80%
- Use pytest fixtures
- Mock external dependencies
Example test:
import pytest
from BinomoAPI import BinomoAPI
@pytest.fixture
def api_client():
return BinomoAPI(
auth_token="test_token",
device_id="test_device",
demo=True
)
def test_place_call_option(api_client):
result = await api_client.place_call_option(
asset="EUR/USD",
duration_seconds=60,
amount=1.0
)
assert result["status"] == "success"Pull Request Guidelines
PR Title Format
Use conventional commits format:
feat: add new featurefix: resolve bug issuedocs: update documentationtest: add testsrefactor: improve code structure
PR Description Template
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Documentation update
- [ ] Performance improvement
- [ ] Code refactoring
## Testing
Describe testing done
## Screenshots
If applicable
## Related Issues
Fixes #issue_numberReview Process
- Code review by maintainers
- CI checks must pass
- Documentation must be updated
- Tests must be included
- Changes must be rebased on main
Development Workflow
1. Feature Development
- Create issue describing feature
- Discuss implementation approach
- Create feature branch
- Implement feature
- Add tests
- Update documentation
- Submit PR
2. Bug Fixes
- Create issue with reproduction steps
- Create fix branch
- Implement fix
- Add regression test
- Submit PR
3. Documentation Updates
- Identify documentation needs
- Create documentation branch
- Update documentation
- Submit PR
Project Structure
BinomoAPI/
├── BinomoAPI/
│ ├── __init__.py
│ ├── api.py
│ ├── exceptions.py
│ ├── models.py
│ └── utils/
├── tests/
│ ├── __init__.py
│ ├── test_api.py
│ └── test_utils.py
├── docs/
│ ├── index.md
│ └── api-reference.md
├── examples/
│ └── basic_usage.py
└── setup.pyCode Review Process
Review Checklist
- Code follows style guide
- Tests are included
- Documentation is updated
- Changes are backwards compatible
- Error handling is appropriate
- Performance impact is considered
Review Comments
- Be constructive
- Explain reasoning
- Provide examples
- Be respectful
Recognition
Contributors
- All contributors are listed in CONTRIBUTORS.md
- Significant contributors become maintainers
- Active contributors get special recognition
Rewards
- Recognition in release notes
- Contributor badges
- Community spotlight
Release Process
Version Numbers
Follow semantic versioning:
- MAJOR.MINOR.PATCH
- Example: 1.2.3
Release Checklist
- Update version number
- Update CHANGELOG.md
- Create release branch
- Run full test suite
- Build documentation
- Create GitHub release
- Deploy to PyPI
Community Guidelines
Communication
- Be respectful
- Stay professional
- Help others
- Share knowledge
Support
- Use GitHub issues for bugs
- Use discussions for questions
- Join Discord community
- Follow Stack Overflow guidelines
License
BinomoAPI is MIT licensed. By contributing, you agree to license your contributions under the same terms.
Thank you for contributing to BinomoAPI!