from datetime import datetime
from pathlib import Path


def process_arguments(arguments):
    """Return arguments dict with types converted"""
    if arguments['<date>'] is not None:
        arguments['<date>'] = datetime.strptime(arguments['<date>'],
                                                '%Y-%m-%d')

    arguments['--directory'] = Path(arguments['--directory']).expanduser()

    for key in ['<seq>', '<week>']:
        if arguments[key] is not None:
            arguments[key] = int(arguments[key])

    return arguments