Converts an integer (1-3999) to a Roman numeral, or parses a Roman numeral back to an integer.
action is to_roman (default) or from_roman. Integers must be 1-3999. Malformed numerals (e.g. "IIII", "VV") are rejected. Computed locally.
An integer 1-3999 for to_roman, or a Roman numeral string for from_roman.
Direction of conversion. Defaults to to_roman.