Skip to content

Contributing

pyhood is in early development and we welcome contributions.

Development Setup

git clone https://github.com/jamestford/pyhood.git
cd pyhood
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pip install responses  # for tests

Running Tests

# All tests
pytest -v

# With coverage
pytest --cov=pyhood --cov-report=term-missing -v

# Single test file
pytest tests/test_auth.py -v

Linting

# Check
ruff check pyhood/

# Auto-fix
ruff check --fix pyhood/

Project Structure

pyhood/
├── pyhood/
│   ├── __init__.py      # Public API (login, logout, refresh)
│   ├── auth.py          # Authentication + token management
│   ├── client.py        # PyhoodClient — high-level API
│   ├── exceptions.py    # Exception hierarchy
│   ├── http.py          # HTTP session, rate limiting, retries
│   ├── models.py        # Typed dataclasses
│   └── urls.py          # Robinhood API endpoints
├── tests/               # Test suite (responses-based mocking)
├── docs/                # MkDocs documentation
└── .github/
    └── workflows/
        └── ci.yml       # GitHub Actions CI

Guidelines

  • Type hints on all public functions and methods
  • Docstrings in Google style
  • Tests for new functionality (aim for >80% coverage)
  • No credentials in code, tests, or docs — use placeholder values
  • Run ruff check and pytest before submitting a PR

Reporting Issues