Thank you for your interest in contributing. XeroConnect is a small, focused library — contributions that keep the package reliable and easy to use are especially welcome.
- Python 3.9 or newer
- Git
git clone https://github.com/alixaprodev/xeroconnect.git
cd xeroconnect
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e ".[dev]"Verify the install:
python -c "from xeroconnect import XeroClient, OAuthClient; print('ok')"All tests use mocked HTTP requests. Do not call the live Xero API in tests.
pytestRun a single test file:
pytest tests/test_invoices.py- Open an issue first for significant changes — especially new endpoints or API surface changes.
- Fork the repository and create a feature branch from
main. - Add or update tests for any behaviour you change.
- Keep the scope small — one logical change per pull request.
- Update documentation when user-facing behaviour changes (
README.md,CHANGELOG.md). - Ensure CI passes —
pytest,python -m build, andtwine check dist/*.
Write clear, concise commit messages in the imperative mood:
Add contact list endpoint
Fix rate limit error message parsing
Update README OAuth example
Add entries under [Unreleased] in CHANGELOG.md following Keep a Changelog conventions:
Added— new featuresChanged— changes to existing behaviourFixed— bug fixesRemoved— removed features
XeroConnect follows simple, readable Python conventions:
- Match existing patterns — read surrounding code before adding new modules.
- Keep modules focused — one resource per file under
xeroconnect/resources/. - Return dicts — API methods return decoded JSON; do not add ORM models without discussion.
- Raise typed exceptions — use the existing hierarchy in
xeroconnect/exceptions.py. - Type hints — add annotations on public functions and methods.
- Docstrings — brief docstrings on public classes and methods; avoid redundant comments.
- No silent failures — API errors must raise exceptions with useful context.
- Create or extend a resource in
xeroconnect/resources/. - Wire the resource in
xeroconnect/client.pyif it is new. - Add tests in
tests/test_<resource>.pyusingpytest-httpx. - Document usage in
README.md. - Add a
CHANGELOG.mdentry.
Use the bug report template. Include:
- XeroConnect version
- Python version
- Steps to reproduce
- Expected vs actual behaviour
- Relevant error messages or stack traces
Do not include access tokens, client secrets, or real tenant data.
Use the feature request template. Explain the business use case and which Xero API endpoint would support it.
XeroConnect intentionally covers a small subset of the Xero API. Not every endpoint belongs in this library.
Open a GitHub Discussion or an issue labelled question for general help.
By contributing, you agree that your contributions will be licensed under the MIT License.