abi3info

2025.11.29 · active · verified Fri Apr 17

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.

Common errors

Warnings

Install

Imports

Quickstart

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.

import abi3info

# Get ABI information for a specific Python version (e.g., 3.11)
python_version = '3.11'
try:
    abi = abi3info.get_abi_info(python_version)
    print(f"ABI information for Python {python_version}:")
    print(f"  Version: {abi.version}")
    print(f"  First ABI version: {abi.first_abi_version}")
    
    # Access a specific member, e.g., PyUnicode_FromWideChar
    if 'PyUnicode_FromWideChar' in abi.members:
        member = abi.members['PyUnicode_FromWideChar']
        print(f"  PyUnicode_FromWideChar signature: {member.signature}")
    else:
        print(f"  PyUnicode_FromWideChar not found in ABI for {python_version}")

    # Get ABI information for the current Python interpreter
    current_abi = abi3info.get_current_abi_info()
    print(f"\nABI information for current Python ({current_abi.version}):")
    print(f"  First ABI version: {current_abi.first_abi_version}")

except ValueError as e:
    print(f"Error: {e}. Check available Python versions with abi3info.SUPPORTED_VERSIONS.")

view raw JSON →