import tempfile


def get_spooled_file_object(s3_client, bucket, key):
    """Get a temporary spooled file object for an S3 object

    :param s3_client Boto s3_client object to apply
    :param bucket: Bucket to upload to
    :param key: key identifying the object within the bucket
    """
    result = tempfile.SpooledTemporaryFile()
    s3_client.download_fileobj(bucket, key, result)
    result.seek(0)
    return result