Comments (4)
I was using clarify 0.4.0 installed via pip.
It looks like the most recent commit (f9bfb09) in this repo solves my issue.
However, I also found that, in 0.4.0, simply deleting the second line here ...
for subjurisdiction_el in vt_el.xpath('./Precinct') + vt_el.xpath('./County'):
subjurisdiction = self.get_result_jurisdiction(subjurisdiction_el.attrib['name'])
subjurisdiction = self._get_or_create_result_jurisdiction(subjurisdiction_el)
...resolved the issue as well.
from clarify.
Oh, interesting, thanks!
from clarify.
Do you anticipate a version bump for Clarify soon on PyPi incorporating that change?
from clarify.
I seem to be having a similar issue. I'm trying to parse Fort Bend County, TX results
, and there are a few odd precinct names. Here is the output I get from the parser:
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.9/site-packages/clarify/parser.py", line 51, in parse
self._contests = self._parse_contests(tree)
File "/usr/local/lib/python3.9/site-packages/clarify/parser.py", line 284, in _parse_contests
return [self._parse_contest(el) for el in contest_els]
File "/usr/local/lib/python3.9/site-packages/clarify/parser.py", line 284, in
return [self._parse_contest(el) for el in contest_els]
File "/usr/local/lib/python3.9/site-packages/clarify/parser.py", line 312, in _parse_contest
for c in self._parse_choices(contest_el, contest):
File "/usr/local/lib/python3.9/site-packages/clarify/parser.py", line 369, in _parse_choices
return [self._parse_choice(c_el, contest)
File "/usr/local/lib/python3.9/site-packages/clarify/parser.py", line 369, in
return [self._parse_choice(c_el, contest)
File "/usr/local/lib/python3.9/site-packages/clarify/parser.py", line 409, in _parse_choice
subjurisdiction = self.get_result_jurisdiction(subjurisdiction_el.attrib['name'])
File "/usr/local/lib/python3.9/site-packages/clarify/parser.py", line 219, in get_result_jurisdiction
return self._result_jurisdiction_lookup[name]
KeyError: '1134 M68'
from clarify.
Related Issues (20)
- Fix subjurisdictions fetcher for new-style summary pages
- Additional usage examples for README
- Mock HTTP responses in tests
- Precinct lookup fails when precinct not in VoterTurnout element HOT 7
- _parse_url not producing the correct report detail URLs HOT 14
- Add support for JSON summary results HOT 2
- Add support for current_ver HOT 1
- KeyError when attempting to access Parser HOT 1
- Add CLI interface HOT 13
- url tests failing in test_jurisdiction (http / https issues) HOT 1
- Add support for getting elections from JSON HOT 2
- Install fails HOT 3
- Handle new-style "Web02" Clarity sites HOT 11
- UnknownTimezoneWarning HOT 2
- Stricter validation of constructor parameters HOT 1
- Fix broken unit test for parser
- New path versions
- Class for fetching, unzipping, parsing results
- Publish to PyPI HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from clarify.