Installation
grelmicro supports Python 3.12+ and depends on Pydantic v2+ and FastDepends. The async runtime is asyncio. Trio is not supported.
Why Python 3.12
grelmicro uses PEP 695 type
parameter syntax, structural Self
returns, and asyncio.timeout
on every primitive. These are 3.11/3.12 features. Pinning the floor
to 3.12 keeps the codebase free of conditional imports and lets ty
check a single typing dialect.
CI runs the test matrix on every advertised classifier (3.12, 3.13, 3.14). Older Python versions are not in scope before 1.0.
Quick install
pip install grelmicro
uv add grelmicro
poetry add grelmicro
Optional extras
grelmicro is modular. Install only the extras you need.
| Extra | Pulls in | Platforms |
|---|---|---|
standard |
orjson for fast JSON serialization. uvloop for a faster event loop. Activate with uvloop.run(main()). |
orjson everywhere. uvloop only on Linux/macOS CPython (skipped on Windows and PyPy). |
redis |
redis-py for the Redis backends. |
All platforms. |
valkey |
valkey-py for the Valkey backends. |
All platforms. |
postgres |
asyncpg for the PostgreSQL backends. |
All platforms. |
sqlite |
aiosqlite for the SQLite backends. |
All platforms. |
kubernetes |
lightkube for the Kubernetes Lease backend. |
All platforms. |
faststream |
faststream for the FastStream integration. |
All platforms. |
opentelemetry |
OpenTelemetry API and SDK for the Trace and Metrics components. |
All platforms. |
instrumentation |
OpenTelemetry instrumentation packages (FastAPI, Redis, asyncpg) for Trace(instrument=...). |
All platforms. |
structlog |
structlog as an alternative logging backend. |
All platforms. |
yaml |
pyyaml for YAML sources in ExternalConfig. |
All platforms. |
pip install "grelmicro[standard]"
pip install "grelmicro[redis]"
pip install "grelmicro[valkey]"
pip install "grelmicro[postgres]"
pip install "grelmicro[sqlite]"
pip install "grelmicro[kubernetes]"
pip install "grelmicro[faststream]"
pip install "grelmicro[opentelemetry]"
pip install "grelmicro[instrumentation]"
pip install "grelmicro[structlog]"
pip install "grelmicro[yaml]"
uv add "grelmicro[standard]"
uv add "grelmicro[redis]"
uv add "grelmicro[valkey]"
uv add "grelmicro[postgres]"
uv add "grelmicro[sqlite]"
uv add "grelmicro[kubernetes]"
uv add "grelmicro[faststream]"
uv add "grelmicro[opentelemetry]"
uv add "grelmicro[instrumentation]"
uv add "grelmicro[structlog]"
uv add "grelmicro[yaml]"
poetry add "grelmicro[standard]"
poetry add "grelmicro[redis]"
poetry add "grelmicro[valkey]"
poetry add "grelmicro[postgres]"
poetry add "grelmicro[sqlite]"
poetry add "grelmicro[kubernetes]"
poetry add "grelmicro[faststream]"
poetry add "grelmicro[opentelemetry]"
poetry add "grelmicro[instrumentation]"
poetry add "grelmicro[structlog]"
poetry add "grelmicro[yaml]"
Combine multiple extras in one call, for example pip install "grelmicro[redis,valkey,opentelemetry,structlog]".