Jinja2 pluralize filters.
Project description
Jinja2 pluralize filters.
Free software: BSD license
Documentation: http://jinja2-pluralize.readthedocs.org
Features
Simple pluralize filter based on inflect.py. For example, this renders as geese:
{{ 'goose'|pluralize }}
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)
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
Built Distribution
File details
Details for the file jinja2_pluralize-0.3.0.tar.gz
.
File metadata
- Download URL: jinja2_pluralize-0.3.0.tar.gz
- Upload date:
- Size: 12.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | df5c2d5017b9b54c0a66cb790cca9fc08945837c3dbfc323589203f1ffb73c1c |
|
MD5 | 42afef9fd52c4768ab5d434f3f908cb4 |
|
BLAKE2b-256 | bb1e9d5a177fd1e4f74091743777518c432ad290c4630aac557b61087dffd6df |
Provenance
File details
Details for the file jinja2_pluralize-0.3.0-py2.py3-none-any.whl
.
File metadata
- Download URL: jinja2_pluralize-0.3.0-py2.py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fec874a591014774d4c66cb7f65314390731bfc57db4c27119db61aa93b2bc4 |
|
MD5 | 00de73ef7f786b8c0de72c2a02373e17 |
|
BLAKE2b-256 | 4026e6a6d7741076ea1bcfac02821e744fc40fa4cbb07e870b7dd969f4af8721 |