Roman Numeral Conversion Utilities
Project description
This is a utility module for converting from and to Roman numerals. It supports numbers upto 3,999,999, using the vinculum to denote multiplication by 1000. (i.e.: X is 10 while X̅ is 10000.) The only letter that this does not apply to is I, as M already existed for 1000.
Special credit goes to Paul M. Winkler, for the original basis for a large chunk of the core converter functions as written in the Python Cookbook.
Quick Start
Install the package:
pip3 install romanicize
Once installed, a command line utility is available to your shell:
$ romanicize 2021 MMXXI $ romanicize MMXIX 2019
With a Python script, convert from an integer to a Roman numeral:
from romanicize import to_numeral print(to_numeral(2021)) # Outputs: MMXXI
Within a Python script, convert from a Roman numeral to an integer:
from romanicize import to_int print(to_int('MV̅DLXXVIII')) # Outputs: 4578
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file romanicize-0.1.1.tar.gz
.
File metadata
- Download URL: romanicize-0.1.1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf267dd9845144661ae38a49d17a701c3962fbc159d2bcd8c0b9970586de7c94 |
|
MD5 | d5f96c552155289a1d78249d83fa2639 |
|
BLAKE2b-256 | 098af33cee3a65cfa1314aacc86fc130cbd6964b29e75b1a24ce69fc8a0a39d9 |