Skip to main content

Jinja2 Pluralize

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.

Metadata

Release files for jinja2_pluralize 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jinja2_pluralize 0.3.0
File Size Uploaded
jinja2_pluralize-0.3.0.tar.gz 12.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jinja2_pluralize 0.3.0
File Interpreter ABI Platform
jinja2_pluralize-0.3.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 17.5 kB

Release files / jinja2_pluralize-0.3.0.tar.gz

Download URL jinja2_pluralize-0.3.0.tar.gz
Size 12.6 kB
Tags Source
SHA-256 checksum
How to use checksums
df5c2d5017b9b54c0a66cb790cca9fc08945837c3dbfc323589203f1ffb73c1c
BLAKE2b-256 checksum
How to use checksums
bb1e9d5a177fd1e4f74091743777518c432ad290c4630aac557b61087dffd6df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / jinja2_pluralize-0.3.0-py2.py3-none-any.whl

Download URL jinja2_pluralize-0.3.0-py2.py3-none-any.whl
Size 4.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
4fec874a591014774d4c66cb7f65314390731bfc57db4c27119db61aa93b2bc4
BLAKE2b-256 checksum
How to use checksums
4026e6a6d7741076ea1bcfac02821e744fc40fa4cbb07e870b7dd969f4af8721
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.1

1 release file

0.2.0

1 release file

0.1.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page