Go to file
su-fang f0a868bb44 changed debian/source/format to native 2022-10-08 15:44:04 +08:00
debian changed debian/source/format to native 2022-10-08 15:44:04 +08:00
src Import Upstream version 3.3 2022-10-08 15:44:03 +08:00
CHANGES.txt Import Upstream version 3.3 2022-10-08 15:44:03 +08:00
MANIFEST.in Import Upstream version 3.3 2022-10-08 15:44:03 +08:00
PKG-INFO Import Upstream version 3.3 2022-10-08 15:44:03 +08:00
README.rst Import Upstream version 3.3 2022-10-08 15:44:03 +08:00
bootstrap.py Import Upstream version 3.3 2022-10-08 15:44:03 +08:00
buildout.cfg Import Upstream version 3.3 2022-10-08 15:44:03 +08:00
setup.cfg Import Upstream version 3.3 2022-10-08 15:44:03 +08:00
setup.py Import Upstream version 3.3 2022-10-08 15:44:03 +08:00
tox.ini Import Upstream version 3.3 2022-10-08 15:44:03 +08:00

README.rst

.. image:: https://travis-ci.org/zopefoundation/roman.svg?branch=master
    :target: https://travis-ci.org/zopefoundation/roman

.. image:: https://coveralls.io/repos/github/zopefoundation/roman/badge.svg?branch=master
    :target: https://coveralls.io/github/zopefoundation/roman?branch=master

.. image:: https://img.shields.io/pypi/v/roman.svg
    :target: https://pypi.org/project/roman/
    :alt: Current version on PyPI

.. image:: https://img.shields.io/pypi/pyversions/roman.svg
    :target: https://pypi.org/project/roman/
    :alt: 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

.. code-block:: python

    import roman

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

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


2. ``roman`` CLI command

.. code-block:: bash

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