Skip to main content

Integer to Roman numerals converter

Project description

https://github.com/zopefoundation/roman/actions/workflows/tests.yml/badge.svg https://coveralls.io/repos/github/zopefoundation/roman/badge.svg?branch=master Current version on PyPI Supported Python versions

roman

Small helper library to convert arabic to roman numerals.

There are two ways to use this library.

  1. Importing it into your application

import roman

# to roman
number = int(input('> ')) # 10
print(roman.toRoman(number))

# from roman
number = input('> ') # X
print(roman.fromRoman(number))
  1. roman CLI command

~$ roman 972
CMLXXII
# use the -r/--reverse to convert Roman numerals
~$ roman -r CMLXXII
972
# case insensitive
~$ roman -r cMlxxii
972

Change log

5.1 (2025-07-18)

  • Hide undocumented special behavior for N behind method parameter. (#30)

5.0 (2025-01-15)

  • Drop support for Python 3.7, 3.8.

  • Add support for lower case roman numerals. (#22)

4.2 (2024-04-25)

  • Remove overlooked mentions of the Python 2.1.1 license (#17)

  • Add support for Python 3.12 and 3.13.

4.1 (2023-05-26)

  • Change license to the Zope Public License (ZPL) version 2.1 (#15)

4.0 (2023-02-28)

  • Add support for Python 3.10, 3.11.

  • Drop support for Python 2.7, 3.5, 3.6.

3.3 (2020-07-12)

  • added support for Python 3.9

  • added CLI command roman with -r/--reverse to convert back from Roman

  • added simple usage instructions

3.2 (2019-04-14)

3.1 (2018-10-24)

  • Added support for Python 3.7.

3.0 (2018-05-28)

  • Added support for Python 3.5, 3.6 and PyPy3.

  • Dropped support for Python 2.6 and 3.3.

2.0.0 (2013-02-25)

  • Added Python 3.3 and PyPy support.

  • Added tests.

1.4.0 (2009-07-23)

  • Initial PyPI release.

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

roman-5.1.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

roman-5.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file roman-5.1.tar.gz.

File metadata

  • Download URL: roman-5.1.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for roman-5.1.tar.gz
Algorithm Hash digest
SHA256 3a86572e9bc9183e771769601189e5fa32f1620ffeceebb9eca836affb409986
MD5 a6442c1e13564b6749e2dccb5d21bd7e
BLAKE2b-256 30868bdb59db4b7ea9a2bd93f8d25298981e09a4c9f4744cf4cbafa7ef6fee7b

See more details on using hashes here.

File details

Details for the file roman-5.1-py3-none-any.whl.

File metadata

  • Download URL: roman-5.1-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for roman-5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bf595d8a9bc4a8e8b1dfa23e1d4def0251b03b494786df6b8c3d3f1635ce285a
MD5 ef866ad2663cb871539a5e55ac85fa22
BLAKE2b-256 f7d027c9840ddaf331ace898c7f4aa1e1304a7acc22b844b5420fabb6d14c3a0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page