--- id: jinja2-simple-tags version: "0.6.1" license: BSD license license_treatment: permissive maintenance: active --- # jinja2-simple-tags — Base classes for quick-and-easy template tag development License: permissive · Maintenance: active · Downloads: 3.1M/mo ## What it is and what it does jinja2-simple-tags is a lightweight library that reduces boilerplate when writing custom Jinja2 template tags. Instead of implementing the full Jinja2 Extension API, you subclass one of three provided tag types—StandaloneTag (for simple output tags), ContainerTag (for tags with opening and closing markers), or InclusionTag (for template inclusion)—and implement a render method. The library handles registration, argument parsing, context access, and output escaping. It's designed for developers building Jinja2-based applications (web frameworks, static site generators, templating systems) who need to extend templates with custom logic without wrestling with Jinja2's lower-level extension machinery. The package supports Python 3.6 and later, depends only on Jinja2, and has no known security vulnerabilities. Use it for: - Add a custom {% now %} tag to templates that outputs the current date and time in a specified format. - Create a {% hmac %} container tag that signs template content with a secret key and returns the digest. - Build an {% include_header %} tag that includes a template fragment with injected context variables like logo paths. - Implement a {% username %} tag that accesses the current request context to render the logged-in user's name. - Define tags that assign their output to template variables using the 'as' keyword for later reuse. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides base classes to create custom Jinja2 template tags (standalone, container, and inclusion types) with minimal boilerplate by implementing a render method. Yes. The package is actively maintained, has no dependencies beyond Jinja2, carries a permissive license, and solves a real problem for anyone building Jinja2 applications. The API is straightforward and well-documented. Install it if you need to write custom template tags and want to avoid boilerplate. ## Install pip install jinja2-simple-tags uv add jinja2-simple-tags poetry add jinja2-simple-tags ## Installing jinja2-simple-tags Before you install: Low friction: pure Python wheel with a single runtime dependency (Jinja2 >= 2.10). Maintained actively with recent commits; last release was in 2024. License in practice: BSD license (permissive) places no restrictions on use, modification, or distribution in proprietary or open-source projects. Quickstart: pip install jinja2-simple-tags from jinja2_simple_tags import StandaloneTag from datetime import datetime class NowExtension(StandaloneTag): tags = {"now"} def render(self, format="%Y-%m-%d %H:%I:%S"): return datetime.now().strftime(format) Verify before relying: - Whether the package is actively maintained beyond the last 2024 release (last commit is dated 2026-04-13 but days_since_release is 891, creating a timeline gap that needs clarification). ## Package facts - License: BSD license (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 3.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags jinja2 custom tags, jinja2 template extensions, create jinja2 tags, jinja2 tag framework, template tag library, jinja2 tag helpers, jinja2-extension, template-tags [View on SkillFed](https://skillfed.io/packages/jinja2-simple-tags) · [View on PyPI](https://pypi.org/project/jinja2-simple-tags/)