Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
602 B
2
Indexable
Never
import requests

url = 'https://lcrannotdb.aei.polsl.pl/api/proteins/'

myobj = {
    "columns": [
        'Protein ID',
        'UniProtACC',
        'Organism',
        'Protein name',
        'Protein Sequence',
        'Protein header',
        'Protein source',
        'Number of LCRs',
        'Number of annotations'

            ],
    "result_data": 'proteins',

    "search_by_column": {
        "Protein source": ['Uniprot']
    }
}

x = requests.post(url, json=myobj)
with open("protein_header.csv", "w") as f:
    f.write(str((x.text).encode('utf-8')))
print(x)