https://github.com/filipporanza/roman_numbers
Convert integers to roman numerals and vice versa
https://github.com/filipporanza/roman_numbers
python python3-6 python3-7 python3-library roman-numerals
Last synced: 9 days ago
JSON representation
Convert integers to roman numerals and vice versa
- Host: GitHub
- URL: https://github.com/filipporanza/roman_numbers
- Owner: FilippoRanza
- License: mit
- Created: 2019-04-23T12:35:55.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-24T15:53:10.000Z (almost 6 years ago)
- Last Synced: 2025-04-14T22:56:24.533Z (9 days ago)
- Topics: python, python3-6, python3-7, python3-library, roman-numerals
- Language: Python
- Homepage:
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# roman_numbers [](https://travis-ci.com/FilippoRanza/roman_numbers) [](https://app.codacy.com/app/FilippoRanza/roman_numbers?utm_source=github.com&utm_medium=referral&utm_content=FilippoRanza/roman_numbers&utm_campaign=Badge_Grade_Dashboard)
Convert integers to roman numerals and vice versa## Description
roman_numbers is a simple Python library that lets you convert from python int to
roman numerals (represented as a python string) or convert from roman numerals
to python int.## Installation
To install this script you need [setuptools](https://github.com/pypa/setuptools)
From the command line run```bash
[sudo] python[3] setup.py install
```If you want to run test locally you can simply
```bash
python[3] test_roman_numbers.py
```or, if you have installed [pytest](https://github.com/pytest-dev/pytest),
you can run```bash
pytest
```## Usage
Once installed you can simply import this module
in the usual way. For a complete function
documentation refer to `pydoc`.## Notes
### Large Numbers
No system to write large roman numeral is currently supported.### Safe Version
Convetion functions are available in two different forms:
+ safe: those versions(function name end with **_safe**) perform
checks on the input, ensuring that input type is correct and
input variables are in the right form.+ fast: those versions don't perform any check on the input,
assuming the values are both of the correct type and in the
correct form.### Correct Input Format
+ `int_to_roman` (integer to roman numeral convertion) consider
as correct input any python integer lerger then zero+ `roman_to_int` (roman numeral to integer convertion) consider
as correct input ant python string that contains a correct
roman numeral and nothing more. To test if a string is correct
or not `is_valid_roman` function is available### Examlpe
See `example.py`