import tempfile


def downloadDataFromBucket(bucket, fileName):
    """ Download a single NEXRAD radar datum.

    Args:
        bucket: A NOAA NEXRAD level 2 radar data bucket.
        fileName: A filename formatted as follows :
            'YYYY/MM/DD/KLMN/KLMNYYYYMMDD_HHMMSS_V06.gz' or
            'YYYY/MM/DD/KLMN/KLMNYYYYMMDD_HHMMSS_V03.gz'

    Returns:
        Temporary version of NEXRAD file.
    """
    s3key = bucket.get_key(fileName)
    localfile = tempfile.NamedTemporaryFile()
    s3key.get_contents_to_filename(localfile.name)
    return localfile