{"id":2755,"library":"roman-numerals-py","title":"roman-numerals-py","description":"This package provides utilities for manipulating well-formed Roman numerals. It is currently at version 4.1.0 and is explicitly deprecated. Users are advised to switch to the `roman-numerals` package instead. The project seems to follow the release cadence of the main `roman-numerals` library.","status":"deprecated","version":"4.1.0","language":"python","source_language":"en","source_url":"https://github.com/AA-Turner/roman-numerals/","tags":["roman numerals","conversion","deprecated","utility"],"install":[{"cmd":"pip install roman-numerals-py","lang":"bash","label":"Install deprecated package"},{"cmd":"pip install roman-numerals","lang":"bash","label":"Install recommended replacement"}],"dependencies":[{"reason":"As of version 4.0.0, `roman-numerals-py` is a meta-package that depends on `roman-numerals` and installs no modules itself. The core functionality is provided by `roman-numerals`.","package":"roman-numerals","optional":false}],"imports":[{"note":"The underlying library is named `roman-numerals`, which is the correct import path even for versions of `roman-numerals-py` prior to it becoming a meta-package. As of v4.0.0, `roman-numerals-py` is a meta-package for `roman-numerals`.","wrong":"from roman_numerals_py import RomanNumeral","symbol":"RomanNumeral","correct":"from roman_numerals import RomanNumeral"},{"note":"Exceptions are also imported from the `roman_numerals` package.","symbol":"InvalidRomanNumeralError","correct":"from roman_numerals import InvalidRomanNumeralError"},{"note":"Exceptions are also imported from the `roman_numerals` package.","symbol":"OutOfRangeError","correct":"from roman_numerals import OutOfRangeError"}],"quickstart":{"code":"from roman_numerals import RomanNumeral, InvalidRomanNumeralError, OutOfRangeError\n\n# Create a RomanNumeral from an integer\nnum_from_int = RomanNumeral(16)\nprint(f\"Integer 16 as Roman: {num_from_int}\") # Expected: XVI\n\n# Create a RomanNumeral from a string\nnum_from_string = RomanNumeral.from_string(\"XVI\")\nprint(f\"Roman 'XVI' as Integer: {int(num_from_string)}\") # Expected: 16\n\n# Convert to uppercase/lowercase\nprint(f\"'XVI' uppercase: {num_from_string.to_uppercase()}\")\nprint(f\"'XVI' lowercase: {num_from_string.to_lowercase()}\")\n\n# Handle invalid input\ntry:\n    RomanNumeral.from_string(\"Spam!\")\nexcept InvalidRomanNumeralError as e:\n    print(f\"Caught expected error for 'Spam!': {e}\")\n\ntry:\n    RomanNumeral(0)\nexcept OutOfRangeError as e:\n    print(f\"Caught expected error for 0: {e}\")","lang":"python","description":"This quickstart demonstrates basic conversion from integers to Roman numerals and vice-versa, as well as handling invalid input. It uses the `RomanNumeral` class from the `roman_numerals` package, which is the underlying library for `roman-numerals-py`."},"warnings":[{"fix":"Uninstall `roman-numerals-py` and install `roman-numerals`: `pip uninstall roman-numerals-py && pip install roman-numerals`. Update any existing import statements from `roman_numerals_py` (if they were used in older versions) to `from roman_numerals import RomanNumeral`.","message":"This package (`roman-numerals-py`) is deprecated. As of version 4.0.0, it functions solely as a meta-package that depends on `roman-numerals` and installs no modules itself. Direct usage should be migrated to `roman-numerals` to avoid future issues and leverage active development.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Ensure your Python environment is version 3.10 or newer. The recommended `roman-numerals` package also supports Python 3.10+.","message":"Version 4.0.0 dropped support for Python 3.9. Users on Python 3.9 or older will encounter compatibility issues.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Always prefer `pip install roman-numerals` and `from roman_numerals import RomanNumeral` for current and future projects.","message":"There is a common confusion between the PyPI package names `roman-numerals-py` and `roman-numerals`. While `roman-numerals-py` is deprecated and acts as a wrapper, `roman-numerals` is the active, standalone library providing the actual Roman numeral manipulation functionality.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'4.1.0':21 'advis':28 'cadenc':45 'convers':55 'current':18 'deprec':25,56 'explicit':24 'follow':42 'form':13 'instead':37 'librari':52 'main':48 'manipul':10 'numer':3,15,35,51,54 'packag':6,36 'project':39 'provid':7 'py':4 'releas':44 'roman':2,14,34,50,53 'roman-numer':33,49 'roman-numerals-pi':1 'seem':40 'switch':30 'user':26 'util':8,57 'version':20 'well':12 'well-form':11","created_at":"2026-04-11T01:41:26.877781+00:00","updated_at":"2026-04-16T21:07:31.136933+00:00","problems":[{"fix":"import roman_numerals_py","cause":"Python module names replace hyphens with underscores, so `roman-numerals-py` must be imported as `roman_numerals_py`.","error":"ModuleNotFoundError: No module named 'roman-numerals-py'"},{"fix":"Either use the correct function names from `roman-numerals-py` (e.g., `from roman_numerals_py import convert_to_roman`), or install and use the recommended `roman-numerals` library.","cause":"The user installed `roman-numerals-py` but is trying to use the API (e.g., `to_roman`, `from_roman`) of the `roman-numerals` library. `roman-numerals-py` uses `convert_to_roman` and `convert_from_roman`.","error":"AttributeError: module 'roman_numerals_py' has no attribute 'to_roman'"},{"fix":"Provide a syntactically correct and valid Roman numeral string, such as `convert_from_roman('IV')`.","cause":"The input string provided to `convert_from_roman` does not represent a valid Roman numeral according to the library's rules (e.g., 'IIII', 'VX').","error":"ValueError: Not a valid Roman numeral"},{"fix":"Ensure the input integer is between 1 and 3999 (inclusive), for example, `convert_to_roman(1994)`.","cause":"The integer provided to `convert_to_roman` is outside the supported range (1 to 3999), such as 0 or 4000.","error":"ValueError: Not a valid integer to convert to Roman numerals"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"4.1.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/AA-Turner/roman-numerals","docs":null,"changelog":null,"pypi":"https://pypi.org/project/roman-numerals-py/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-28","next_check":"2026-07-28","install_tag":null}}