import textwrap


def _get_embl_wrapper(embl_key, indent=5, subsequent_indent=None, width=80):
    """Returns a textwrap.TextWrapper for embl records (eg, write
    <key>   <string> by providing embl key and a string. Wrap text to
    80 column"""

    # define the string to prepen (eg "OC   ")
    prepend = '{key:<{indent}}'.format(key=embl_key, indent=indent)

    # deal with 2° strings and more
    if subsequent_indent is None:
        subsequent_prepend = prepend

    else:
        subsequent_prepend = '{key:<{indent}}'.format(
            key=embl_key, indent=subsequent_indent)

    # define a text wrapper object
    wrapper = textwrap.TextWrapper(
        initial_indent=prepend,
        subsequent_indent=subsequent_prepend,
        width=width
        )

    return wrapper