A Django template filter to convert Arabic numerals to Roman numerals
Project description
Django Roman is a Django template tag application to convert Arabic numerals into Roman numerals.
Original Roman numeral conversion code adapted from Dive Into Python 3 by Mark Pilgrim.
Install
$ pip install django-roman
Add to settings.py.
INSTALLED_APPS = [
# ...
'roman',
]
Usage
Convert Arabic numerals to Roman numerals with the roman template filter.
{% load roman_tags %}
{{ "Party like it's 1999."|roman }}
Result:
Party like it's <span class="numerals numerals-roman">MCMXCIX</span>.
Can also be imported as a standalone Python module:
>>> from roman import roman
>>> roman(1999)
'MCMXCIX'
>>> roman("1999")
'MCMXCIX'
>>> from roman import arabic
>>> arabic("MCMXCIX")
1999
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
django-roman-0.2.2.tar.gz
(5.6 kB
view hashes)
Built Distribution
Close
Hashes for django_roman-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2efd6e514b058f1cb3d55df1d9bd0112d4b622db09a408c2ca955de3f5819a56 |
|
MD5 | 344232da1c651923df9ea3b99af56dc8 |
|
BLAKE2b-256 | d13c908952122b05e33079aa4832f9b06f7968672cb3f03849b23178c5fb1c1a |