def _clean_table_name(domain, readable_name):
    name_slug = '_'.join(unidecode.unidecode(readable_name).lower().split(' '))
    # 63 = max postgres table name, 24 = table name prefix + hash overhead
    max_length = 63 - len(domain) - 24
    return name_slug[:max_length]
Slugifies and truncates readable name to make a valid configurable report table name.
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/userreports/app_manager.py/_clean_table_name