Thanks for your interest in contributing to ibc-api! This guide covers
everything you need to get started.
- Python 3.10+
- Git
# Clone the repository
git clone git@github.com:areed1192/interactive-brokers-api.git
cd interactive-brokers-api
# Install in editable mode with all dev dependencies
pip install -e ".[dev,async,docs]"python -m pytest tests/ --tb=short -qAll tests must pass before submitting a pull request.
ruff check .Line length is set to 120 characters.
mkdocs build --strict
mkdocs serve # Preview at http://127.0.0.1:8000ibc/
├── client.py # Main client entry point
├── session.py # Synchronous HTTP session with retry/rate limiting
├── async_session.py # Async HTTP session (httpx)
├── websocket.py # WebSocket streaming client
├── models.py # Typed dataclass response/request models
├── exceptions.py # Custom exception hierarchy
├── rest/ # REST service classes (one per API domain)
└── utils/ # Auth, gateway, enums
samples/ # Runnable usage examples
tests/ # Unit tests (pytest)
docs/ # MkDocs documentation source
- Branch from
master— create a feature branch for your work. - One logical change per PR — don't combine unrelated changes.
- Add tests — new features need unit tests in
tests/. - Add a sample — user-facing features need an example in
samples/. - Update the changelog — add entries under
## [Unreleased]inCHANGELOG.md. - Follow existing conventions — match the style of surrounding code.
- Type hints on all public method signatures.
from __future__ import annotationsat the top of every module.- Docstrings follow Google style.
- No
print()in library code — uselogging.getLogger(__name__). - Input validation at public API boundaries using
IBCValidationError.
When adding a new API endpoint that returns structured data:
- Add a frozen dataclass to
ibc/models.pywith afrom_dict()classmethod. - For request bodies, add a
to_dict()method. - Return the model from the REST service method instead of a raw dict.
This project requires signed commits. Configure GPG signing:
git config commit.gpgsign true
git config user.signingkey YOUR_KEY_IDOpen an issue on GitHub.