{"id":9434,"library":"abi3info","title":"abi3info","description":"abi3info is a Python library that provides programmatic access to information about CPython's stable ABI (Application Binary Interface), commonly referred to as 'abi3'. This includes details on types, functions, and macros available for creating compatible C extension modules. The current version is 2025.11.29, and it has a high release cadence, often driven by automated updates to its internal ABI data.","status":"active","version":"2025.11.29","language":"en","source_language":"en","source_url":"https://github.com/woodruffw/abi3info","tags":["CPython","ABI","extension modules","stable ABI","c-api"],"install":[{"cmd":"pip install abi3info","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"symbol":"get_abi_info","correct":"import abi3info\nabi_info = abi3info.get_abi_info('3.11')"},{"symbol":"get_current_abi_info","correct":"import abi3info\ncurrent_abi = abi3info.get_current_abi_info()"}],"quickstart":{"code":"import abi3info\n\n# Get ABI information for a specific Python version (e.g., 3.11)\npython_version = '3.11'\ntry:\n    abi = abi3info.get_abi_info(python_version)\n    print(f\"ABI information for Python {python_version}:\")\n    print(f\"  Version: {abi.version}\")\n    print(f\"  First ABI version: {abi.first_abi_version}\")\n    \n    # Access a specific member, e.g., PyUnicode_FromWideChar\n    if 'PyUnicode_FromWideChar' in abi.members:\n        member = abi.members['PyUnicode_FromWideChar']\n        print(f\"  PyUnicode_FromWideChar signature: {member.signature}\")\n    else:\n        print(f\"  PyUnicode_FromWideChar not found in ABI for {python_version}\")\n\n    # Get ABI information for the current Python interpreter\n    current_abi = abi3info.get_current_abi_info()\n    print(f\"\\nABI information for current Python ({current_abi.version}):\")\n    print(f\"  First ABI version: {current_abi.first_abi_version}\")\n\nexcept ValueError as e:\n    print(f\"Error: {e}. Check available Python versions with abi3info.SUPPORTED_VERSIONS.\")\n","lang":"python","description":"This quickstart demonstrates how to fetch ABI information for a specific Python version and for the currently running interpreter. It shows how to access members and their signatures from the returned AbiInfo object."},"warnings":[{"fix":"Always use the latest version of `abi3info` if you require the most up-to-date ABI data. Be aware that relying on specific ABI signatures in your code might require `abi3info` updates.","message":"The ABI data provided by abi3info (e.g., `stable_abi.toml`) is frequently updated. This means the specific set of available members or their exact signatures for a given Python target version can change between different versions of the `abi3info` library.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure your environment uses Python 3.10 or a newer version (e.g., `python3.10 -m pip install abi3info`).","message":"The `abi3info` library requires Python 3.10 or newer. Attempting to install or run it on older Python versions will result in an installation error or runtime syntax errors.","severity":"breaking","affected_versions":"<3.10"},{"fix":"Refer to the `members` dictionary on the `AbiInfo` object to see available entries. Understand the scope of `abi3` before querying specific symbols.","message":"The `abi3` refers to a stable subset of the CPython API. It does not include all CPython internal functions. Attempting to query information for non-abi3 functions or non-existent members will result in KeyError or AttributeError.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Install the library using pip: `pip install abi3info`.","cause":"The `abi3info` library is not installed in your current Python environment.","error":"ModuleNotFoundError: No module named 'abi3info'"},{"fix":"Check `abi3info.SUPPORTED_VERSIONS` to see which Python versions have ABI data available in your installed `abi3info` version. Ensure you are using a recent `abi3info` release for broader coverage.","cause":"You are requesting ABI information for a Python version that is either not supported by this `abi3info` release, or too old for the `abi3` concept itself (which started gaining stability around 3.2). The `requires_python` is >=3.10, but the data coverage might vary.","error":"ValueError: Unknown version: '3.9'"},{"fix":"Consult the library's documentation or inspect the `AbiInfo` object's attributes (e.g., `dir(abi_info)`) to verify available fields. Specific ABI members are accessed via `abi_info.members['SymbolName']` which is a dictionary.","cause":"You are trying to access a field or method on the `AbiInfo` object that does not exist or has been renamed.","error":"AttributeError: 'AbiInfo' object has no attribute 'non_existent_field'"}]}