jinja2-strcase
A python package for converting string case in jinja2 templates
What it is and what it does
jinja2-strcase is a Jinja2 extension that brings string-case conversion utilities into template rendering. It ports the Go strcase library to Python, exposing filters like to_snake, to_camel, to_kebab, and their screaming variants (uppercase versions) for use directly in Jinja2 templates and cookiecutter projects. The package is a pure-Python wheel with only jinja2 as a runtime dependency, making installation straightforward.
The extension is designed for template authors who need to transform string case during rendering—for example, converting user input or variable names into different naming conventions without leaving the template layer. It supports both Python 2 and Python 3 (though classifiers list versions up to 3.8), and carries an MIT license. However, the package is dormant: the last release was 2020-06-21 and the repository has seen no commits since 2023-09-26, so compatibility with recent Jinja2 or Python versions is unverified.
Use it for:
- Convert variable names to snake_case in Jinja2 templates for code generation or configuration files.
- Transform user-provided strings to camelCase or kebab-case within cookiecutter templates during project scaffolding.
- Generate API field names in different case conventions from a single template source.
- Normalize naming conventions in template-driven documentation or code comment generation.
- Apply case transformations to identifiers in dynamic template rendering without post-processing.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds string-case conversion filters to Jinja2 templates, enabling conversions like snake_case, kebab-case, and camelCase within template rendering.
Yes, if you are actively using Jinja2 or cookiecutter and need string-case conversion filters in templates. The package is lightweight, carries no security vulnerabilities, and has a permissive license. However, be aware that it is dormant and untested against modern Jinja2 versions—verify compatibility with your environment before relying on it in production.
Install
jinja2-strcase on PyPI
pip
pip install jinja2-strcaseuv
uv add jinja2-strcasepoetry
poetry add jinja2-strcaseInstalling jinja2-strcase
Before you install
Low friction; pure Python wheel with only jinja2 as a runtime dependency. Maintenance is dormant—last release was 2020-06-21 and the repository has not been updated since 2023-09-26, so expect no active support for newer Jinja2 versions or Python releases.
License in practice
MIT license is permissive; you may use, modify, and distribute this package freely with minimal restrictions, making it suitable for both open-source and commercial projects.
Quickstart
from jinja2 import Environment
env = Environment(extensions=['jinja2_strcase.StrcaseExtension'])
template = env.from_string("{{ 'Any kind of string' | to_snake }}")
print(template.render()) # Output: any_kind_of_string
Verify before relying
- Whether the package remains compatible with current Jinja2 versions, given the last release was in 2020 and no updates since 2023.
- Support status for Python versions beyond 3.8, which was the latest listed in classifiers at release time.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — jinja2 |
| Maintenance | dormant — 2,245 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 774,083/month — #5,097 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: jinja2_strcase-0.0.2-py2.py3-none-any.whl
Keywords: jinja2, extension, strcase
Tags
More Text Processing packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyparsingpyparsing provides a library for building text…
permissive · top 1,000 on PyPI
docutilsDocutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
RapidFuzzRapidFuzz provides fast fuzzy string matching…
permissive · top 1,000 on PyPI
tinycss2tinycss2 parses CSS strings into token and…
permissive · top 1,000 on PyPI
llama-parseLlamaParse parses complex documents (PDFs,…
permissive · top 1,000 on PyPI
jinja2-ansible-filtersProvides a collection of Jinja2 template…
copyleft · top 5,000 on PyPI
textcaseConverts strings between different text case…
permissive · top 15,000 on PyPI
jinja2-humanize-extensionAdds humanize library filters to Jinja2…
permissive · top 5,000 on PyPI
jinja2-timeJinja2 extension that adds template tags for…
permissive · top 5,000 on PyPI
case-convertConverts strings between different case formats…
copyleft · top 15,000 on PyPI
jinja2_pluralizeProvides Jinja2 template filters for…
permissive · top 15,000 on PyPI
camel-converterConverts strings and dictionary keys between…
permissive · top 5,000 on PyPI
pyhumpsConverts strings and dictionary keys between…
permissive · top 5,000 on PyPI
cookiecutterCookiecutter is a command-line tool that…
unclear · top 5,000 on PyPI
makeGenerates project directory structures and…
permissive · top 15,000 on PyPI