|
| 1 | +# OpenDecree Python SDK — Claude Context |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +Python SDK for the OpenDecree configuration service. Wraps the gRPC API with sync and async |
| 6 | +clients, a field-watching subscription layer, and optional OpenTelemetry instrumentation. |
| 7 | + |
| 8 | +## Tech Stack |
| 9 | + |
| 10 | +| Concern | Tool | |
| 11 | +|---------|------| |
| 12 | +| Language | Python 3.10+ | |
| 13 | +| Transport | grpcio | |
| 14 | +| Serialization | protobuf, googleapis-common-protos | |
| 15 | +| Code generation | grpcio-tools (Docker) | |
| 16 | +| Lint / format | ruff | |
| 17 | +| Type checking | mypy | |
| 18 | +| Tests | pytest, pytest-asyncio | |
| 19 | +| Docs | pdoc | |
| 20 | + |
| 21 | +## Development |
| 22 | + |
| 23 | +### Prerequisites |
| 24 | + |
| 25 | +Python 3.10+, Docker (for proto generation), Make. |
| 26 | + |
| 27 | +### Key Commands |
| 28 | + |
| 29 | +```bash |
| 30 | +make generate # regenerate proto stubs + _constants.py (Docker) |
| 31 | +make lint # ruff check + format check |
| 32 | +make typecheck # mypy |
| 33 | +make test # pytest (unit) |
| 34 | +make integration # pytest -m integration (requires live server) |
| 35 | +make pre-commit # lint + typecheck + test |
| 36 | +``` |
| 37 | + |
| 38 | +### Layout |
| 39 | + |
| 40 | +``` |
| 41 | +sdk/ |
| 42 | +├── src/opendecree/ # public package |
| 43 | +│ ├── _generated/ # generated proto stubs (committed) |
| 44 | +│ └── ... |
| 45 | +├── tests/ # unit + integration tests |
| 46 | +└── pyproject.toml |
| 47 | +``` |
| 48 | + |
| 49 | +## Coding Guidelines |
| 50 | + |
| 51 | +See [coding-guidelines.md](https://github.com/opendecree/decree/blob/main/docs/development/coding-guidelines.md) |
| 52 | +for the shared philosophy (vanilla principle, minimal deps) and the Python-specific section |
| 53 | +(runtime deps, type annotations, asyncio patterns, ruff enforcement). |
| 54 | + |
| 55 | +## Conventions |
| 56 | + |
| 57 | +- Generated proto stubs live in `sdk/src/opendecree/_generated/` and are committed |
| 58 | +- `_constants.py` is generated from `pyproject.toml` via `build/gen-constants.py` |
| 59 | +- Apache 2.0 license |
0 commit comments