Skip to main content

A Django template filter to convert Arabic numerals to Roman numerals

Project description

PyPI version Build status Documentation status

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.3.tar.gz (5.6 kB view hashes)

Uploaded Source

Built Distribution

django_roman-0.2.3-py3-none-any.whl (7.4 kB view hashes)

Uploaded Python 3

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