Welcome to numeral-system-py’s documentation!

License Release Supported versions Docs Code Coverage Build status Appveyor Build Status Travis CI Contact Blog

numeral-system-py

Convert from one numeric system to other in python.

Supports following:

  • roman numerals

  • positional numerals (like binary, arabic (decimal), hexadecimal and others)

Example of usage

Roman

>>> import numeral_system
>>> numeral_system.roman.encode(7)
'VII'
>>> numeral_system.roman.decode('XXII')
22

Positional

>>> import numeral_system
>>> numeral_system.positional.encode(42, 2)
'101010'
>>> numeral_system.positional.encode(12, 3)
'110'
>>> numeral_system.positional.decode(101, 2)
5
>>> numeral_system.positional.decode('AF', 16)
175

Indices and tables