sustainable-processes / pura

Clean chemical data quickly
MIT License
10 stars 3 forks source link

Searches for partial names #18

Closed marcosfelt closed 2 years ago

marcosfelt commented 2 years ago

Can searches be done for partial names?

e.g., DuPhos - https://pubchem.ncbi.nlm.nih.gov/#query=DuPhos

marcosfelt commented 2 years ago

PubChem does seem to have an autocomplete feature in their API: https://pubchemdocs.ncbi.nlm.nih.gov/autocomplete

So, it can resolve duphos for example. Calling https://pubchem.ncbi.nlm.nih.gov/rest/autocomplete/compound/duphos/json?limit=6 gives

{
    "status": {
        "code": 0
    },
    "total": 6,
    "dictionary_terms": {
        "compound": [
            "(R,R)-i-Pr-DUPHOS",
            "(S,S)-i-Pr-DUPHOS",
            "(S,S)-Me-DUPHOS",
            "(S,S)-Et-DUPHOS-Rh",
            "(R,R)-Me-DUPHOS",
            "(R,R)-Ethyl-DUPHOS"
        ]
    }
}