def prody_contacts(**kwargs):
    """Identify contacts of a target structure with one or more ligands.
    Contacting atoms (or extended subset of atoms, such as residues) are
    outputted in PDB file format.

    :arg target: target PDB identifier or filename

    :arg ligand: ligand PDB identifier(s) or filename(s)

    :arg select: atom selection string for target structure

    :arg radius: contact radius (Å), default is ``4.0``

    :arg extend: output same ``'residue'``, ``'chain'``, or ``'segment'`` along
        with contacting atoms

    :arg prefix: prefix for output file, default is *target* filename

    :arg suffix: output filename suffix, default is *ligand* filename"""
    import prody
    LOGGER = prody.LOGGER
    target = prody.parsePDB(kwargs['target'])
    title = kwargs.get('prefix') or target.getTitle()
    selstr = kwargs.get('select')
    if selstr:
        target = target.select(selstr)
    contacts = prody.Contacts(target)
    suffix = kwargs.get('suffix', '_contacts')
    extend = kwargs.get('extend')
    radius = float(kwargs.get('radius', 4.0))
    ligands = kwargs.get('ligand')
    if len(ligands) > 1:
        outfn = lambda fn: title + suffix + '_' + fn + '.pdb'
    else:
        outfn = lambda fn: title + suffix + '.pdb'
    for pdb in ligands:
        ligand = prody.parsePDB(pdb)
        sel = contacts(radius, ligand)
        if sel:
            LOGGER.info('{0} atoms from {1} contact {2}.'.format(len(sel),
                pdb, str(target)))
            if extend:
                sel = target.select('same ' + extend + ' as sel', sel=sel)
                LOGGER.info(
                    'Selection is extended to {0} atoms of the same {1}(s).'
                    .format(len(sel), extend))
            pdbfn = outfn(ligand.getTitle())
            LOGGER.info('Writing contacts into ' + pdbfn)
            prody.writePDB(pdbfn, sel)
