@@ -0,0 +1,1354 @@
+import requests%0Aimport progressbar%0Aimport pandas as pd%0A%0Abar = progressbar.ProgressBar()%0A%0A%0Adef create_civic_drug_disease_dataframe():%0A    payload = %7B'count': 999%7D  # Only 295 genes at time of writing%0A    request = requests.get('https://civic.genome.wustl.edu/api/genes/', params=payload)%0A    assert request.status_code == 200, 'Request failed: %7B%7D'.format(request.status_code)%0A%0A%0A    records = request.json()%5B'records'%5D%0A%0A    # Create records in the format:  Cancer, Gene, Drugs, Variant-Name, Aliases, Description%0A    info = %5B%5D%0A    for record in bar(records):%0A        gene = record%5B'name'%5D%0A        description = record%5B'description'%5D%0A        aliases = ','.join(record%5B'aliases'%5D)%0A        variants = record%5B'variants'%5D%0A%0A        for variant in variants:%0A            var_name = variant%5B'name'%5D%0A            var_id = variant%5B'id'%5D%0A            var = requests.get('https://civic.genome.wustl.edu/api/variants/%7B%7D'.format(var_id)).json()%0A            for evidence in var%5B'evidence_items'%5D:%0A                disease = evidence%5B'disease'%5D%5B'name'%5D%0A                drugs = ','.join(%5Bx%5B'name'%5D for x in evidence%5B'drugs'%5D%5D)%0A                info.append((disease, drugs, gene, aliases, var_name, description))%0A%0A    # Create DataFrame%0A    labels = %5B'Cancer', 'Drugs', 'Gene', 'Aliases', 'Variant-Name', 'Description'%5D%0A    return pd.DataFrame.from_records(info, columns=labels)%0A

Add function to retrieve CIViC Drug / Disease information