Code Monkey home page Code Monkey logo

roman_numbers's Introduction

roman_numbers Build Status Codacy Badge

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 From the command line run

[sudo] python[3] setup.py install

If you want to run test locally you can simply

python[3] test_roman_numbers.py

or, if you have installed pytest, you can run

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

roman_numbers's People

Contributors

codacy-badger avatar filipporanza avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.