States
State
Source code in src\backend\us\states.py
shapefile_urls()
Shapefiles are available directly from the US Census Bureau: https://www.census.gov/cgi-bin/geo/shapefiles/index.php
Source code in src\backend\us\states.py
lookup(val, field=None, use_cache=True)
State lookup. This method will make a best effort attempt at finding the state based on the lookup value provided.
- two digits will search for FIPS code
- two letters will search for state abbreviation
Exact matches can be done on any attribute on State objects by passing
the field
argument. This does an exact, case-sensitive comparison against
the specified field.
This method caches non-None results, but can the cache can be bypassed
with the use_cache=False
argument.