comparison python/states.py @ 0:f3ab51c79813

adding configuration from https://svn.openplans.org/svn/config_jhammel/
author k0s <k0scist@gmail.com>
date Thu, 15 Oct 2009 11:41:26 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f3ab51c79813
1 states = {
2 "AL": "Alabama",
3 "AK": "Alaska",
4 "AS": "American Samoa",
5 "AZ": "Arizona",
6 "AR": "Arkansas",
7 "AE": "Army P.O. Box",
8 "AP": "Army Post Office",
9 "CA": "California",
10 "CO": "Colorado",
11 "CT": "Connecticut",
12 "DE": "Delaware",
13 "DC": "District of Columbia",
14 "FL": "Florida",
15 "GA": "Georgia",
16 "GU": "Guam",
17 "HI": "Hawaii",
18 "ID": "Idaho",
19 "IL": "Illinois",
20 "IN": "Indiana",
21 "IA": "Iowa",
22 "KS": "Kansas",
23 "KY": "Kentucky",
24 "LA": "Louisiana",
25 "ME": "Maine",
26 "MD": "Maryland",
27 "MA": "Massachusetts",
28 "MI": "Michigan",
29 "MN": "Minnesota",
30 "MS": "Mississippi",
31 "MO": "Missouri",
32 "MT": "Montana",
33 "NE": "Nebraska",
34 "NV": "Nevada",
35 "NH": "New Hampshire",
36 "NJ": "New Jersey",
37 "NM": "New Mexico",
38 "NY": "New York",
39 "NC": "North Carolina",
40 "ND": "North Dakota",
41 "OH": "Ohio",
42 "OK": "Oklahoma",
43 "OR": "Oregon",
44 "OT": "Other",
45 "PA": "Pennsylvania",
46 "PR": "Puerto Rico",
47 "RI": "Rhode Island",
48 "SC": "South Carolina",
49 "SD": "South Dakota",
50 "TN": "Tennessee",
51 "TX": "Texas",
52 "US": "United States",
53 "UT": "Utah",
54 "VT": "Vermont",
55 "VI": "Virgin Islands",
56 "VA": "Virginia",
57 "WA": "Washington",
58 "WV": "West Virginia",
59 "WI": "Wisconsin",
60 "WY": "Wyoming",
61 }
62
63 def getstate(query):
64 """
65 return the state name of the query,
66 or None if its not in the list
67 """
68
69 if query in states.keys():
70 return states[query]
71
72 if query in states.values():
73 return query
74
75 return None