Contributing¶
See CONTRIBUTING.md for the full guide.
Quick links¶
Adding a new provider¶
Providers can be added to the stockfeed core or distributed as third-party packages via entry points.
Core provider checklist¶
- Create
src/stockfeed/providers/<name>/with__init__.py,provider.py,normalizer.py - Inherit
AbstractProviderinprovider.py - Inherit
BaseNormalizerinnormalizer.py - Add a config key to
StockFeedSettingsinconfig.py - Add
_instantiatelogic inProviderSelector._instantiate() - Add
_has_authmapping inProviderSelector._has_auth() - Register in
src/stockfeed/providers/__init__.py - Add JSON fixtures to
tests/fixtures/providers/<name>/ - Add unit tests to
tests/unit/providers/test_<name>.py - Verify provider contract tests pass:
pytest tests/unit/providers/test_contract.py
Third-party provider (entry points)¶
# in your provider package's pyproject.toml
[project.entry-points."stockfeed.providers"]
myprovider = "myprovider.provider:MyProvider"
ProviderRegistry.discover_entry_points() loads all registered entry points on startup.
Running tests¶
Run only provider contract tests:
Code standards¶
- Linting:
uv run ruff check src/ tests/ - Formatting:
uv run ruff format src/ tests/ - Type checking:
uv run mypy src/ - Docstrings: NumPy style on all public methods
- Coverage gate: 90% enforced in CI