Skip to content

Latest commit

 

History

History
49 lines (33 loc) · 1.16 KB

README.rst

File metadata and controls

49 lines (33 loc) · 1.16 KB
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