Skip to main content
Join the official Python Developers Survey 2018 and win valuable prizes: Start the survey!

Jinja2 pluralize filters.

Project description

https://img.shields.io/pypi/v/jinja2_pluralize.svg?style=flat https://travis-ci.org/audreyr/jinja2_pluralize.svg?branch=master https://api.codacy.com/project/badge/eb497c487012455688a62383afccccb7 https://img.shields.io/pypi/pyversions/jinja2_pluralize.svg?style=flat https://img.shields.io/pypi/status/jinja2_pluralize.svg?style=flat

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.3.0 (2015-10-09)

  • Fix RST formatting on PyPI.
  • Stable status.
  • Test on Python 3.4 and 3.5.
  • Add more badges to README.

0.2.1 (2014-07-09)

  • Remove the shebang from __init__.py (#2), thanks to @dashea.

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.

Filename, size & hash SHA256 hash help File type Python version Upload date
jinja2_pluralize-0.3.0-py2.py3-none-any.whl (4.8 kB) Copy SHA256 hash SHA256 Wheel 3.4 Oct 9, 2015
jinja2_pluralize-0.3.0.tar.gz (12.6 kB) Copy SHA256 hash SHA256 Source None Oct 9, 2015

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page