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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file django-roman-0.2.3.tar.gz.

File metadata

  • Download URL: django-roman-0.2.3.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for django-roman-0.2.3.tar.gz
Algorithm Hash digest
SHA256 6e75b4fe25a4daa3c7ae4771b2f2a699029b2f883e23aab5620b0e7df243fb46
MD5 8ce47179af00d0347296f46ddb8f3e69
BLAKE2b-256 a6d7bd8bf862372f39e1a840036ac41b61c699ce7564331b877cbbee93403e7e

See more details on using hashes here.

File details

Details for the file django_roman-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: django_roman-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for django_roman-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8f2a8a713efa705685eb6172147a560e2b77031c18343fc64cfe9c122fa0d5ee
MD5 4929d6748cc86a48b3d1cdc3f1d7e137
BLAKE2b-256 da28bf4a1b009cd2e76427b7b6ff6fffb8bd8f8d9eed3f3686849e7857a94d09

See more details on using hashes here.

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