Registry / type-stubs / types-chevron

types-chevron

JSON →
library0.14.2.20260408pypypiunverified

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-chevron
INSTALL
IMPORT
SIG · TYPES-CHEVRON
T
types-chevron
type-stubspythonv0.14.2.20260408
Install
1.6s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.14.2.20260408 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.9MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 1.6s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

chevron
import chevron
You import the runtime library (`chevron`) directly. `types-chevron` provides type hints for it, but you do not import `types-chevron` itself at runtime. Type checkers automatically discover and use the installed stubs.

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.

import chevron from typing import Dict, Any def render_template(template_str: str, data: Dict[str, Any]) -> str: """Renders a Mustache template using chevron.""" rendered = chevron.render(template=template_str, data=data) return rendered # Example 1: Basic string rendering template_string = "Hello, {{ name }}!" context_data = {'name': 'World'} output = render_template(template_string, context_data) print(f"Rendered output (string): {output}") # Example 2: Rendering from a file (create a dummy file first) with open("my_template.mustache", "w") as f: f.write("The secret number is {{ number }}.") with open('my_template.mustache', 'r') as f: file_context_data = {'number': 42} file_output = render_template(template_str=f, data=file_context_data) print(f"Rendered output (file): {file_output}") # Type checking benefits: # If 'number' was expected to be an int but a str was passed, # a type checker (e.g., Mypy, Pyright) would flag a potential issue # even though Python itself would run the code. # Example: render_template(template_string, {'name': 123}) # A type checker might warn here.
Debug
Known issues
gotchaThe `types-chevron` package aims to provide accurate annotations for `chevron==0.14.*`. Using a `chevron` version significantly different from this target might lead to inaccurate or missing type hints, potentially causing false positives or negatives in your static type checks.
fix
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`.
affects: all
gotcha`types-chevron` is a stub-only package and contains no runtime code. Installing it without the actual `chevron` library will not provide any templating functionality, only type information for a non-existent runtime dependency, leading to `ModuleNotFoundError` at runtime if `chevron` itself is not installed.
fix
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.
affects: all
breakingDue to the nature of type stubs, any version bump of `types-chevron` can introduce changes that might make your code fail to type check, even if the underlying `chevron` runtime library has not changed. This is because stubs define the expected interface for static analysis, and changes to these definitions can affect type checker output.
fix
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.
affects: all
Upgrade
Version history
0.14.2.20260408latest on PyPI · released Apr 8, 2026
Audit
Dependencies
chevronrequiredThis package provides type stubs for the `chevron` templating library. The actual `chevron` runtime library is required for any functionality.
Agent activity
21 hits · last 30 days
node
18
OpenAI (training)
1
Resources