import re
import zipfile


def instance_name_from_zip(path):
    """Determines the instance filename within a SEC EDGAR zip archive."""
    re_instance_name = re.compile(r'.+-\d{8}\.xml')
    for name in zipfile.ZipFile(path).namelist():
        if re_instance_name.fullmatch(name):
            return name
    raise RuntimeError('Zip archive does not contain a valid SEC instance file.')