from functools import reduce
from collections.abc import Mapping, Sequence


def extract_attribute_value(obj, path, default=None):
    def _get_step(current, key):
        if current is None:
            return default
        if isinstance(current, Mapping) and key in current:
            return current[key]
        if isinstance(current, Sequence) and not isinstance(current, (str, bytes)):
            if key.isdigit():
                idx = int(key)
                return current[idx] if 0 <= idx < len(current) else default
        return getattr(current, key, default)
    if not path:
        return obj
    return reduce(_get_step, path.split('.'), obj)

