Skip to main content

Convert roman numeral to number and manage roman number object

Project description

Roman numerals

Manage roman numerals using roman number object.

Convert roman numeral to integers

  • roman function

return roman numeral string

import roman_numbers as r

x = 10
print(r.roman(x))

Output:

>> X
  • roman(number:int, extend=1) extended function

return roman numeral string

import roman_numbers as r

x = 7580
print(r.roman(x, extend=1))

Output:

>> V̅MMDLXXX
  • number function

return integers from roman numeral

import roman_numbers as r

x = 'X'
print(r.number(x))

Output:

>> 10
  • rom object

support Basic and Compare opeartion for roman numeral

from roman_numbers import rom

>> rom(10) + rom(10) # add
>> XX

>> rom(5) - rom(1) # sub
>> IV

>> rom(5) * 3 # mul
>> XV

>> rom('V') > rom('XI') # compare
>> False

>> rom('V') == 5 # compare
>> True

>> int(rom('XI'))
>> 11

Version

1.0.1 - Release 1.0.2 - Add description and minor fix

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

roman_numbers-1.0.2.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

roman_numbers-1.0.2-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file roman_numbers-1.0.2.tar.gz.

File metadata

  • Download URL: roman_numbers-1.0.2.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.3

File hashes

Hashes for roman_numbers-1.0.2.tar.gz
Algorithm Hash digest
SHA256 fb84b7755ba972d549e73fac1c100f0eeb9fc247474d43d0f433c0b72152c699
MD5 d68856e6758e79dc07f51b79588fd2fb
BLAKE2b-256 95cee9f6b0d260f48713f2d735e0986ee4ead311cd168c217c5f94b0fad6817b

See more details on using hashes here.

File details

Details for the file roman_numbers-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: roman_numbers-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.3

File hashes

Hashes for roman_numbers-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ffbc00aaf41538208f975d1b1ccfe80372bae1866e7cd632862d8c6b45edf447
MD5 f2985ace8c4baec74aa7cb5fad642e15
BLAKE2b-256 9a8509e9e6bd6cd4cc0ed463d2b6ce3c7741698d45ca157318730a1346df4819

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page