def _download_biogrid_data(url):
    """Downloads zipped, tab-separated Biogrid data in .tab2 format.

    Parameters:
    -----------
    url : str
        URL of the BioGrid zip file.

    Returns
    -------
    csv.reader
        A csv.reader object for iterating over the rows (header has already
        been skipped).
    """
    res = requests.get(biogrid_file_url)
    if res.status_code != 200:
        raise Exception('Unable to download Biogrid data: status code %s'
                        % res.status_code)
    zip_bytes = BytesIO(res.content)
    zip_file = ZipFile(zip_bytes)
    zip_info_list = zip_file.infolist()
    # There should be only one file in this zip archive
    if len(zip_info_list) != 1:
        raise Exception('There should be exactly zipfile in BioGrid zip '
                        'archive: %s' % str(zip_info_list))
    unzipped_bytes = zip_file.read(zip_info_list[0]) # Unzip the file
    biogrid_str = StringIO(unzipped_bytes.decode('utf8')) # Make file-like obj
    csv_reader = csv.reader(biogrid_str, delimiter='\t') # Get csv reader
    next(csv_reader) # Skip the header
    return csv_reader
def _download_biogrid_data ( url ) : res = requests . get ( biogrid_file_url ) if res . status_code != 200 : raise Exception ( 'Unable to download Biogrid data: status code %s' % res . status_code ) zip_bytes = BytesIO ( res . content ) zip_file = ZipFile ( zip_bytes ) zip_info_list = zip_file . infolist ( ) if len ( zip_info_list ) != 1 : raise Exception ( 'There should be exactly zipfile in BioGrid zip ' 'archive: %s' % str ( zip_info_list ) ) unzipped_bytes = zip_file . read ( zip_info_list [ 0 ] ) biogrid_str = StringIO ( unzipped_bytes . decode ( 'utf8' ) ) csv_reader = csv . reader ( biogrid_str , delimiter = '\t' ) next ( csv_reader ) return csv_reader
Downloads zipped, tab-separated Biogrid data in .tab2 format.

    Parameters:
    -----------
    url : str
        URL of the BioGrid zip file.

    Returns
    -------
    csv.reader
        A csv.reader object for iterating over the rows (header has already
        been skipped).