larzroman
Roman numerals, explained.
A small, satisfying way to understand a non-positional number system (a companion to base conversion). Convert integers to Roman numerals and back, validate them, and see the breakdown symbol by symbol - how MCMXCIV becomes 1994.
larzscript pkg install roman
What you get
- to_roman / from_roman (1-3999)
- Round-trip validation (rejects IIII)
- explain() the symbol breakdown
- Pairs with larzbase
Try it
import "roman" as roman
print(roman.to_roman(1994))
print(roman.from_roman("MCMXCIV"))
print(roman.is_valid("IIII"))
print(roman.explain(1994))Output
MCMXCIV 1994 false M = 1000 CM = 900 XC = 90 IV = 4 = MCMXCIV (1994)
Why it's in the Larz Stack
larzroman is a real Larzscript package (larzscript pkg install roman) - money-native, zero dependencies, the same language as the rest of the estate, not a separate Python runtime. It composes with the rest of the Larz Stack and the Larz framework.