World’s tiniest Roman ↔ Decimal number converter — ~1 KB, zero deps. Single-file, CLI included. Perfect for code-golf, minimal containers, or just for fun.
- ✅
int → ROMANandROMAN → int(case-insensitive) - ✅ Standard subtractive forms:
IV, IX, XL, XC, CD, CM - ✅ Classic 1–3999 supported; >3999 continues with repeated
M - ✅ Zero dependencies, single tiny file
- ✅ CLI:
nano-roman
# Local (from repo)
python app_min.py 3999 # MMMCMXCIX
python app_min.py XL # 40After installing:
# CLI
pip install nano-roman
nano-roman 1984 # -> MCMLXXXIV
nano-roman XLII # -> 42
nano-roman mmxxv # -> 2025- Minimal token table (S and V) + greedy subtractive matching
- No heavy parsing/regex trees, no dependencies
- Single module + tiny CLI wrapper
- Convert the current year
(Get-Date -Format yyyy) | % { nano-roman $_ } # 2025 -> MMXXVdate +%Y | xargs nano-roman # 2025 -> MMXXV- “Roman clock” (hour only)
(Get-Date -Format HH) | % { nano-roman $_ } # 14 -> XIVdate +%I | xargs nano-roman # 07 -> VII- Git tag in Roman
git tag "v$(nano-roman 2025)" && git push origin "v$(nano-roman 2025)"- Batch convert a list
printf "4\n9\n42\n1999\n" | while read n; do nano-roman "$n"; done
# IV, IX, XLII, MCMXCIX- Quick Windows alias
Set-Alias r nano-roman
r 3999 # -> MMMCMXCIXNotes
- Classical Roman numerals have no zero and no negative values.
- For values >3999, this tool renders repeated
M(ASCII extension). Classical notation would use overlines (vinculum) or parentheses ×1000.
MIT © 2025