jinja2-simple-tags
Base classes for quick-and-easy template tag development
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 on this page — 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
jinja2-simple-tags on PyPI
pip
pip install jinja2-simple-tagsuv
uv add jinja2-simple-tagspoetry
poetry add jinja2-simple-tagsInstalling 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 the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — Jinja2 |
| Maintenance | actively maintained — 891 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 3,090,115/month — #2,759 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: jinja2_simple_tags-0.6.1-py2.py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
Jinja2Jinja2 is a templating engine that renders…
permissive · top 100 on PyPI
html5taggerGenerates HTML5 markup programmatically using…
permissive · top 5,000 on PyPI
jinja2-fragmentsRenders individual Jinja2 template blocks as…
permissive · top 15,000 on PyPI
jinja2-timeJinja2 extension that adds template tags for…
permissive · top 5,000 on PyPI
docxtplGenerates Word documents (.docx) from templates…
copyleft · top 5,000 on PyPI
django-render-blockRender a specific block from a Django template…
permissive · top 15,000 on PyPI
Flask-MomentFlask-Moment adds moment.js date and time…
permissive · top 15,000 on PyPI
jinja_partialsAdds a `render_partial()` function to Jinja2…
permissive · top 5,000 on PyPI
jinjanatorA command-line tool that renders Jinja2…
permissive · top 5,000 on PyPI
lacesLaces provides Django components that bundle…
permissive · top 5,000 on PyPI