from datetime import datetime


def filename_factory(**kwargs):
    """Get a function which generates a filename with a timestamp."""
    return lambda: '{name}-{timestamp}.{format}'.format(
        timestamp=datetime.utcnow().replace(microsecond=0).isoformat(),
        **kwargs
    )