types-chevron is a PEP 561 type stub package that provides static type annotations for the `chevron` templating library. It is part of the `typeshed` project, the central repository for third-party library stubs, and is used by static analysis tools like mypy, pyright, and PyCharm to enable type checking and autocompletion for code using `chevron`. This package specifically targets type annotations for `chevron` version `0.14.*`. It is actively maintained with daily releases from typeshed.
pip install chevron types-chevronVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates basic usage of the `chevron` library, for which `types-chevron` provides static type information. The `types-chevron` package is automatically used by type checkers (like mypy or Pyright) and IDEs to provide type hints, autocompletion, and error detection without requiring direct imports of `types-chevron` itself. The example includes both string and file-based template rendering.
Ensure your installed `chevron` version aligns with the `types-chevron` target version. It is good practice to pin both `chevron` and `types-chevron` to compatible versions in your `requirements.txt` or `pyproject.toml`.
Always install both `chevron` and `types-chevron` (e.g., `pip install chevron types-chevron`) to ensure both runtime functionality and static type checking capabilities are available.
Pin specific versions of `types-chevron` in your project dependencies (e.g., `types-chevron==0.14.2.20260408`) to maintain consistent type checking behavior, especially in CI/CD environments. Regularly review updates to `types-chevron` for changes to the stubbed API.