Jinja2 Inflection banner
lesleslie lesleslie

Jinja2 Inflection

Development community

Description

Jinja2 extension that integrates the 'inflection' library's string transformation functions as template filters

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

jinja2-inflection

[![Code style: crackerjack](https://img.shields.io/badge/code%20style-crackerjack-000042)](https://github.com/lesleslie/crackerjack) [![Python: 3.13+](https://img.shields.io/badge/python-3.13%2B-green)](https://www.python.org/downloads/) ![Coverage](https://img.shields.io/badge/coverage-100.0%25-brightgreen)

A Jinja2 extension that integrates the [inflection](https://github.com/jpvanhal/inflection) library's string transformation functions as template filters.

Overview

`jinja2-inflection` is a Jinja2 extension that provides a set of filters for string transformation using the `inflection` library. This package allows you to easily manipulate strings in your Jinja2 templates by converting between different naming conventions, pluralizing words, and more.

Key Features

  • String Transformation Filters: Access a variety of filters that apply inflection functions to strings in templates.
  • Easy Integration: Seamlessly add the extension to your Jinja2 environment, making the filters available in all templates.
  • Reusable Logic: Encapsulate inflection functions as filters to promote code reuse and consistency across templates.
  • Parameter Support: Filters support optional parameters for customized string transformations.

Filters

The extension provides the following filters:

Filter Description Example
camelize Converts strings to CamelCase {{ 'product_category' | camelize }}ProductCategory
dasherize Replaces underscores with dashes {{ 'first_name' | dasherize }}first-name
humanize Makes text more human-readable {{ 'employee_salary' | humanize }}Employee salary
ordinal Returns the ordinal suffix for a number {{ 1 | ordinal }}st
ordinalize Turns a number into an ordinal string {{ 1 | ordinalize }}1st
parameterize Replaces special chars with hyphens `{{ 'Donald E. Knuth' | paramet