Contributing¶
Contributions are welcome — from bug reports to new broker integrations. This page covers the development workflow.
Reporting Bugs and Requesting Features¶
Open an issue on GitHub Issues. For bug reports, please include:
- PriceHub version (
pip show pricehub) - Python version
- A minimal reproducer (broker, symbol, interval, dates)
- The full exception traceback if applicable
For feature requests, describe the use case rather than the implementation — that lets us evaluate alternatives.
Development Setup¶
git clone https://github.com/eslazarev/pricehub.git
cd pricehub
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e .
pip install mypy black pylint pytest pytest-cov pytest-mock
Running Checks Locally¶
The CI pipeline runs four checks; reproduce them locally before opening a PR.
# Type checking
mypy --install-types --non-interactive --explicit-package-bases .
# Linting
pylint pricehub
# Formatting (max line length 120)
black --line-length 120 pricehub tests
# Tests with coverage
pytest --cov=pricehub
Adding a New Broker¶
- Add a module under
pricehub/brokers/modeled on the existing implementations (Binance, Bybit, etc.). - Register the broker identifier in the
SupportedBrokerliteral. - Add unit tests in
tests/mirroring the structure of existing broker tests, usingpytest-mockto stub HTTP responses. - Update
docs/api.mdwith the new broker string anddocs/usage.mdwith at least one example. - Add the broker to the support matrix in
docs/index.mdandREADME.md.
Pull Request Checklist¶
- [ ] Tests added or updated;
pytestpasses locally - [ ]
mypy,pylint,blackall pass - [ ] Documentation updated for any user-facing changes
- [ ] PR description explains the why of the change, not only the what
Code of Conduct¶
This project follows the Contributor Covenant 2.1. By participating, you agree to abide by its terms. Reports of unacceptable behavior can be sent to elazarev@gmail.com.
License¶
By contributing to PriceHub you agree that your contributions will be licensed under the MIT License, matching the project's license.