8""""8 8""""8
8 eeeee eeeee eeeee eeee 8 eeeee e e e eeee
8eeeee 8 8 8 8 8 8eeeee 8 8 8 8 8
88 8e 8eee8 8e 8eee 88 8e 8eeee8 8e 8eee
e 88 88 88 8 88 88 e 88 88 88 88 88
8eee88 88 88 8 88 88ee 8eee88 88 88 88eee 88ee
A Python library that standardizes the names of U.S. states
- Submit a state’s name, postal abbreviation or fips code and receive a clean object with all other formats as attributes.
- State objects also provide the “stateface” code for ProPublica’s web font of state shapes
Getting started is as easy as…
$ pip install latimes-statestyle
Then start feeding it your data:
>> import statestyle
>>> obj = statestyle.get('CA')
>>> print obj.name
California
>>> print obj.postal
CA
>>> print obj.ap
Calif.
>>> obj = statestyle.get(6)
>>> print obj.name
California
>>> obj.stateface
"E"