Contributing to libreclient¶
Thanks for your interest in contributing! Here's how to get started.
Quick Start¶
git clone https://github.com/jjeff07/libreclient.git
cd libreclient
uv sync
git config core.hooksPath .githooks
Workflow¶
- Fork the repository
- Branch from
dev(notmain) - Make changes — write code, add tests
- Commit using Conventional Commits (the hook will validate)
- Push and open a PR against
dev
What We're Looking For¶
- New routes — Support for future API endpoints as LibreNMS evolves
- Bug fixes — Found something broken? Fix it and add a regression test
- Tests — Increase coverage, especially functional tests
- Documentation — Improve docstrings, README, or examples
Code Standards¶
- All code is linted and formatted by Ruff (CI will auto-fix minor issues)
- Maximum cognitive complexity of 15 per function (enforced by complexipy)
- Tests are required for new features and bug fixes
- Commit messages must follow Conventional Commits format (see COMMIT_TYPES.md for quick reference)
Adding a New Route¶
- Create
src/libreclient/routes/myroute.pywith an async class - Create
src/libreclient/routes/myroute_sync.pywithMyRouteSync = synchronizer.wrap(...) - Create
src/libreclient/models/myroute.pywith Pydantic response models - Add exports to
models/__init__.py - Wire up in
client.py(both sync and async) - Run
uv run python scripts/generate_stubs.py(regenerates stubs androutes/__init__.py) - Add unit tests in
tests/unit/routes/andtests/unit/models/
Running Tests¶
# Unit tests
uv run pytest tests/unit
# Functional tests (needs .env with LIBRENMS_URL and LIBRENMS_TOKEN)
uv run pytest tests/functional
Questions?¶
Open an issue — happy to help you get started.