···66import re
7788# [TODO]: values can be '128.', perhaps remove the dot in that case?
99+# [TODO]: properties have references and comments which do not exist in the
1010+# Result item, but should be included eventually.
9111012class NIST(Source):
1313+ """NIST Scraper plugin
1414+1515+ This plugin manages searching for a chemical on the NIST website
1616+ and parsing the resulting page if the chemical exists on NIST.
1717+ """
1118 website = "http://webbook.nist.gov/*"
12191320 search = 'cgi/cbook.cgi?Name=%s&Units=SI&cTP=on'
···7683 return requests
77847885 def parse_generic_info(self, sel):
8686+ """Parses: synonyms, chemical formula, molecular weight, InChI,
8787+ InChiKey, CAS number
8888+ """
7989 ul = sel.xpath('body/ul[li/strong="IUPAC Standard InChI:"]')
8090 li = ul.xpath('li')
8191···117127 return requests
118128119129 def parse_aggregate_data(self, table, symbol_table):
130130+ """Parses the table(s) which contain possible links to individual
131131+ data points
132132+ """
120133 results = []
121134 for tr in table.xpath('tr[td]'):
122135 extra_data_url = tr.xpath('td[last()][a="Individual data points"]'
···151164152165 @staticmethod
153166 def parse_transition_data(table, symbol_table):
167167+ """Parses the table containing properties regarding phase changes"""
154168 results = []
155169156170 name = table.xpath('@summary').extract()[0]
···176190177191 @staticmethod
178192 def parse_generic_data(table):
193193+ """Parses the common tables of 4 and 5 rows. Assumes they are of the
194194+ form:
195195+ Symbol (unit)|Temperature (K)|Method|Reference|Comment
196196+ Symbol (unit)|Temperature (K)|Reference|Comment
197197+ """
179198 results = []
180199181200 name = table.xpath('@summary').extract()[0]
···199218200219 @staticmethod
201220 def parse_antoine_data(table):
221221+ """Parse table containing parameters for the Antione equation"""
202222 results = []
203223204224 name = table.xpath('@summary').extract()[0]
···217237 return results
218238219239 def parse_individual_datapoints(self, response):
240240+ """Parses the page linked from aggregate data"""
220241 sel = Selector(response)
221242 table = sel.xpath('//table[@class="data"]')[0]
222243