skillfed

jinja2-strcase

A python package for converting string case in jinja2 templates

jinja2-strcase v0.0.2 774.1K downloads/30d#5,097 on PyPI8
Permissive license MIT DORMANT released

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-strcase

uv

uv add jinja2-strcase

poetry

poetry add jinja2-strcase

Installing 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

Development Status :: 3 - AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

Tags

jinja2 string case conversiontemplate case filterssnake case camel case templatesjinja2 text transformationcookiecutter string formattingjinja2 extension filterscase conversion filters
jinja2-extensiontemplate-utilitiescookiecutter

More Text Processing packages