def license_to_dict(lico):
    """
    Return a dict of license data with texts usable for API calls given a ``lico``
    ScanCode License object. Fields with empty values are not included.
    """
    licm = dict(
        key=lico.key,
        category=lico.category,
        short_name=lico.short_name,
        name=lico.name,
        owner=lico.owner,
        is_exception=lico.is_exception,
        language=lico.language or "en",
        full_text=lico.text,
        spdx_license_key=lico.spdx_license_key,
        reference_notes=lico.notes,
        homepage_url=lico.homepage_url,
        text_urls="\n".join(lico.text_urls or []),
        osi_url=lico.osi_url,
        faq_url=lico.faq_url,
        other_urls="\n".join(lico.other_urls or []),
    )
    return {k: v for k, v in licm.items() if v}