--- id: types-jinja2 version: "2.11.9" license: Apache-2.0 license license_treatment: permissive maintenance: active --- # types-Jinja2 — Typing stubs for Jinja2 License: permissive · Maintenance: active · Downloads: 2.5M/mo ## What it is and what it does types-Jinja2 is a PEP 561 type stub package that provides type information for the Jinja2 templating engine. It allows static type checkers like mypy, PyCharm, and pytype to understand and validate code that uses Jinja2, catching type errors before runtime. The stubs are maintained in the typeshed repository and are sourced from the Python community's central type stub collection. However, this package is now largely obsolete. Jinja2 itself has included native type annotations since version 3.0, eliminating the need for separate stubs. If you are using Jinja2 3.0 or newer, you should uninstall types-Jinja2 and rely on Jinja2's built-in type support instead. This package remains useful only for projects still using older Jinja2 versions that lack native type information. Use it for: - Adding type checking to legacy projects using Jinja2 < 3.0 without native type stubs - Enabling mypy or PyCharm to validate Jinja2 template rendering code in older codebases - Supporting static analysis in CI/CD pipelines for projects locked to pre-3.0 Jinja2 versions ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides PEP 561 type stubs for Jinja2, enabling type checkers like mypy and PyCharm to validate code that uses Jinja2. No, unless you are constrained to Jinja2 < 3.0. For modern projects, Jinja2 3.0+ includes its own type annotations, making this package redundant. The package has not been updated since 2021 and is explicitly marked as superseded in its own documentation. Install only if you cannot upgrade Jinja2 itself. ## Install pip install types-jinja2 uv add types-jinja2 poetry add types-jinja2 ## Installing types-Jinja2 Before you install: Low friction install with a single lightweight runtime dependency (types-MarkupSafe). However, the package has not been updated since 2021-11-26 and is now superseded—Jinja2 itself has included type annotations since version 3.0, making this package redundant for modern Jinja2 installations. License in practice: Licensed under Apache-2.0 (permissive), which allows free use, modification, and distribution with minimal restrictions. No licensing concerns for most projects. Quickstart: pip install types-Jinja2 # In your Python code, type checkers will now understand Jinja2 types import jinja2 env: jinja2.Environment = jinja2.Environment() Only needed if using Jinja2 < 3.0; Jinja2 3.0+ includes its own type stubs, making this package unnecessary. Verify before relying: - Whether the stubs remain accurate for Jinja2 versions released after 2021-11-26 - Compatibility with the latest versions of type checkers (mypy, PyCharm, pytype) ## Package facts - License: Apache-2.0 license (permissive) - Python support: unspecified - Install friction: low - Maintenance: active - Downloads: 2.5M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags jinja2 type stubs, type checking jinja2, mypy jinja2 types, pep 561 stubs, jinja2 type hints, static type checking templates, type-stubs, deprecated [View on SkillFed](https://skillfed.io/packages/types-jinja2) · [View on PyPI](https://pypi.org/project/types-jinja2/)