import textwrap


def format_fasta(name, seq, wrap=60):
    """
    Formats a sequence as a string of a fasta entry.

    >>> print(format_fasta('seq_name', 'ACTGTCATCATGTGC', wrap=5))
    >seq_name
    ACTGT
    CATCA
    TGTGC
    """
    return ">{}\n{}".format(name, textwrap.fill(seq, width=wrap))