def _precinct_xls_metadata(self, election):
        meta_entries = []
        year = election['start_date'].split('-')[0]
        base_url = self._precinct_xls_base_url(election)
        extension = self._precinct_xls_extension(election)

        if year == '2006':
            name_suffix = "%20County"
        else:
            name_suffix = ""

        for county in self._counties():
            raw_filename = "{}{}.{}".format(county['name'], name_suffix,
                extension)
            if (year == '2010' and election['race_type'] == 'general' and
                    raw_filename == "Linn.xls"):
                # The precinct-level result file for Linn County in the
                # 2010-11-02 general election inexplicably has a .xlsx
                # extension.
                raw_filename = "Linn.xlsx"
            meta_entries.append({
                "generated_filename": self._standardized_filename(election,
                    reporting_level='precinct', jurisdiction=county['name'],
                    extension='.'+extension),
                'raw_url': base_url + '/' + raw_filename,
                'ocd_id': county['ocd_id'],
                'name': county['name'],
                'election': election['slug'],
            })

        return meta_entries
Get metadata entries for precinct-level results in per-county Excel files.
dataset/ETHPy150Open openelections/openelections-core/openelex/us/ia/datasource.py/Datasource._precinct_xls_metadata