bw2io.chemidplus
#
Module Contents#
Classes#
Use the ChemIDPlus API to lookup synonyms for chemicals, including pesticides. |
Functions#
CAS numbers have up to ten digits; we remove zero padding and add hyphens where needed. |
Attributes#
- exception bw2io.chemidplus.Missing[source]#
Bases:
Exception
404 or other error code returned.
Parameters#
- exceptionException
Exception to raise.
Initialize self. See help(type(self)) for accurate signature.
- exception bw2io.chemidplus.Multiple[source]#
Bases:
Exception
Multiple results for given search query.
Parameters#
- exceptionException
Exception to raise.
Initialize self. See help(type(self)) for accurate signature.
- class bw2io.chemidplus.ChemIDPlus[source]#
Use the ChemIDPlus API to lookup synonyms for chemicals, including pesticides.
Always used to match against a master list. Seeded with names from ecoinvent.
Attributes#
- api_cachedict
Dictionary with raw data from API, key is canonical name.
- master_mappingdict
Dictionary from synonyms, including canonical names, to master flows.
- forbidden_keysset
Identifiers that aren’t unique in the ChemIDPlus system.
Methods#
- match(synonym, search=True)
Match a synonym to a master flow.
- match_cas(number)
Match a CAS number to a master flow.
- process_request(request)
Process a request to the ChemIDPlus API.
- load_cache()
Load the cache of API results.
- save_cache()
Save the cache of API results.
- CAS_TEMPLATE = 'https://chem.nlm.nih.gov/api/data/search?data=complete&exp=rn%2Feq%2F{cas}'[source]#