def ecp_block(molecule, keywords):
    """
    Generate a block of input for any effective core potentials to add

    Arguments:
        molecule (autode.species.Species):
        keywords (autode.wrappers.keywords.Keywords):

    Returns:
        (str):
    """
    ecp_kwd = keywords.ecp

    if ecp_kwd is None:
        return ""   # No ECP is defined in these keywords

    # Set of unique atomic symbols that require an ECP
    ecp_elems = set(atom.label for atom in molecule.atoms
                    if atom.atomic_number >= ecp_kwd.min_atomic_number)

    if len(ecp_elems) == 0:
        return ""   # No atoms require an ECP

    ecp_str = '\necp\n'
    ecp_str += '\n'.join(f'  {label}   library  {ecp_kwd.nwchem}'
                         for label in ecp_elems)
    ecp_str += '\nend'

    return ecp_str