pycensus.census.countries.usa.elections_precinct.official¶
Official (state election authority) precinct results -- the ONLY source of precinct-level votes in the US study.
REGISTRY maps a state FIPS to a module whose load(cache_dir) returns precinct polygons (EPSG:4326) with county_fips,
votes_dem, votes_rep, votes_total and which defines ATTRIBUTION. A state without an entry has NO precinct election data:
load_state_precincts returns (None, "") -- compilations by newspapers or research groups (NYT, VEST, MEDSL) are not used.
load_state_precincts(state_fips, cache_dir=None)
¶
(precincts, attribution) from the state's official loader; (None, "") when the state has none or the loader fails.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state_fips
|
str
|
2-digit state FIPS. |
required |
cache_dir
|
Optional[str]
|
Cache folder; |
None
|