""" Returns the name of a state (or territory or province) for a given abbreviation. This works for all the U.S. States, Territories, and Possessions, and all the Canadian Provinces. It even works for the unambiguous U.S. Military address abbreviations ("AE" is used for several different locations and so is just renturned as "Armed Forces"). It doesn't work for Mexico as there isn't an official two-letter code mapping for the Mexican States. """ # Copyright © 2004 Saugus.net, Inc. # All Rights Reserved. # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. stateMapping={# U.S. States 'AL':'Alabama', 'AK':'Alaska', 'AZ':'Arizona', 'AR':'Arkansas', 'CA':'California', 'CO':'Colorado', 'CT':'Connecticut', 'DE':'Delaware', 'FL':'Florida', 'GA':'Georgia', 'HI':'Hawaii', 'ID':'Idaho', 'IL':'Illinois', 'IN':'Indiana', 'IA':'Iowa', 'KS':'Kansas', 'KY':'Kentucky', 'LA':'Louisiana', 'ME':'Maine', 'MD':'Maryland', 'MA':'Massachusetts', 'MI':'Michigan', 'MN':'Minnesota', 'MS':'Mississippi', 'MO':'Missouri', 'MT':'Montana', 'NE':'Nebraska', 'NV':'Nevada', 'NH':'New Hampshire', 'NJ':'New Jersey', 'NM':'New Mexico', 'NY':'New York', 'NC':'North Carolina', 'ND':'North Dakota', 'OH':'Ohio', 'OK':'Oklahoma', 'OR':'Oregon', 'PA':'Pennsylvania', 'RI':'Rhode Island', 'SC':'South Carolina', 'SD':'South Dakota', 'TN':'Tennessee', 'TX':'Texas', 'UT':'Utah', 'VT':'Vermont', 'VA':'Virginia', 'WA':'Washington', 'WV':'West Virginia', 'WI':'Wisconsin', 'WY':'Wyoming', # U.S. Territories and Possessions 'AS':'American Samoa', 'DC':'District of Columbia', 'FM':'Federated States of Micronesia', 'GU':'Guam', 'MH':'Marshall Islands', 'MP':'Northern Mariana Islands', 'PW':'Palau', 'PR':'Puerto Rico', 'VI':'Virgin Islands', # Unambiguous U.S. Military 'AA':'Armed Forces Americas', 'AP':'Armed Forces Pacific', 'AE':'Armed Forces', # Canada 'AB':'Alberta', 'BC':'British Columbia', 'MB':'Manitoba', 'NB':'New Brunswick', 'NL':'Newfoundland and Labrador', 'NT':'Northwest Territories', 'NS':'Nova Scotia', 'NU':'Nunavut', 'ON':'Ontario', 'PE':'Prince Edward Island', 'QC':'Quebec', 'SK':'Saskatchewan', 'YT':'Yukon' } return stateMapping.get(abbr,'unknown')