Skip to main content

Jinja2 pluralize filters.

Project description

https://badge.fury.io/py/jinja2_pluralize.png https://travis-ci.org/audreyr/jinja2_pluralize.png?branch=master https://pypip.in/d/jinja2_pluralize/badge.png

Jinja2 pluralize filters.

Features

  1. Simple pluralize filter based on inflect.py. For example, this renders as geese:

{{ 'goose'|pluralize }}
  1. Django-style pluralize filter. Works as described in the Django docs. For example, this renders as votes:

vote{{ 0|pluralize }}

Usage

To use it with Jinja2, update the filters dict on the environment like this:

from jinja2 import Environment
from jinja2_pluralize import pluralize_dj

env = Environment()
env.filters['pluralize'] = pluralize_dj
tmpl = env.from_string('vote{{ 0|pluralize }}')
assert tmpl.render() == 'votes'

History

0.2.0 (2014-07-02)

  • Package works as per the README.

0.1.0 (2014-04-25)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jinja2_pluralize-0.2.0.tar.gz (12.2 kB view details)

Uploaded Source

File details

Details for the file jinja2_pluralize-0.2.0.tar.gz.

File metadata

File hashes

Hashes for jinja2_pluralize-0.2.0.tar.gz
Algorithm Hash digest
SHA256 96649a8f2c5e5c1058b68b68c7a93e572831bbb9774accdcf62449b56bfc28e7
MD5 f75d2bf778f7865edd0c6b3639648a27
BLAKE2b-256 69eddda57cb4b1f750820e827353ad2738f6c50a103db3ded76c44f43916bbb1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page