A python package for converting string case in jinja2 templates
Project description
jinja2-strcase
A python package for converting string case in jinja2 templates (including cookiecutter).
It is a port of the go package strcase
Installation
jinja2-strcase is available for download from PyPI via pip:
$ pip install jinja2-strcase
Example
from jinja2 import Environment
env = Environment(extensions=['jinja2_strcase.StrcaseExtension'])
# This will convert 'Any kind of string' -> 'any_kind_of_string'
template = env.from_string("{% 'Any kind of string' | to_snake }")
template.render()
Function | Result |
---|---|
to_snake |
any_kind_of_string |
to_screaming_snake |
ANY_KIND_OF_STRING |
to_kebab |
any-kind-of-string |
to_screaming_kebab |
ANY-KIND-OF-STRING |
to_camel |
AnyKindOfString |
to_lower_camel |
anyKindOfString |
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jinja2-strcase-0.0.2.tar.gz
(2.9 kB
view hashes)
Built Distribution
Close
Hashes for jinja2_strcase-0.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3067062f6158cd836ab495f805fc0d1d83cf92049e180509b004db86f6b745c |
|
MD5 | 25a7e66db3faa8c3eff22e23d6218f78 |
|
BLAKE2b-256 | fa3f821f2adeb240ffca16a3f89f56aa3733a99574a023e02ed31446bbdf4f61 |