Thank you for considering contributing to the Bling ERP API SDK!
-
Clone the repository:
git clone https://github.com/tempont/bling-erp-api-python.git cd bling-erp-api-python -
Install dependencies with
uv:uv sync --all-groups
-
Run the full check suite to verify everything works:
make check
This project uses:
- Ruff for linting and formatting (see
pyproject.tomlfor configuration) - basedpyright for type checking (strict mode)
Run linting and formatting before committing:
uv run ruff check . && uv run ruff format --check .Or let pre-commit handle it:
uv run pre-commit run --all-filesSome models and contracts are generated from the Bling OpenAPI specification:
make codegenThis runs the scripts under scripts/:
generate_openapi_contracts.py— generates resource contractsgenerate_models.py— generates Pydantic models
Generated files live in:
src/bling_erp_api/contracts/generated/src/bling_erp_api/models/generated/docs/resources/
Run the test suite:
uv run python -m pytestOr with coverage:
uv run python -m pytest --cov=bling_erp_apiImportant: Tests must not make real API calls unless explicitly gated behind environment variables. Use pytest-httpx for HTTP mocking.
Follow the checklist in AGENTS.md (located in the repository root) for adding new endpoints. The key steps are:
- Find the operation in
specs/bling-openapi-reference.json - Add resource/action mappings to
scripts/generate_openapi_contracts.py - Run contract generation
- Create or update the resource class in
src/bling_erp_api/resources/ - Add the resource namespace to the client
- Add tests (contract tests, resource mapping tests, model tests)
- Fork the repository
- Create a feature branch (
git checkout -b feat/my-feature) - Make your changes
- Run
make checkto verify - Commit with a clear message
- Push and open a pull request
For deep conventions on naming, docstrings, model structure, and resource implementation, see the AGENTS.md file in the repository root. It documents the complete project design decisions and per-endpoint checklist.
By contributing, you agree that your contributions will be licensed under the MIT License.