[Pymoney-general] Structure for per-country currency information
Brought to you by:
facundobatista
From: Facundo B. <fac...@gm...> - 2005-06-28 10:05:56
|
I proposed originally that we have a structure, after parsing the ISO list = at http://www.iso.org/iso/en/prods-services/popstds/currencycodeslist.html?pri= ntable=3Dtrue like the following: {..., "ARS": ("ARGENTINA", "Argentine Peso", "032"), ... } Darek Suchojad noted that the first code, as different countrys have the exactly same currency, will be reapeated (which is a problem as we're using a dictionary), so he proposed: {..., "ARS": (("ARGENTINA", "Argentine Peso", "032"),), ... "USD": (("AMERICAN SAMOA", "US Dollar", "840"), ("BRITISH INDIAN OCEAN TERRITORY", "US Dollar", "840"), ... ), ... } Jeff Kowalczyk went a step further and suggested a new denomination for currencies, just to make them univocal, proposing the following structure (note how he flattened the structure). { ..., "AS-USD" : ("AMERICAN SAMOA", "US Dollar", "840"), "IO-USD" : ("BRITISH INDIAN OCEAN TERRITORY", "US Dollar", "840"), "US-USD" : ("UNITED STATES", "US Dollar", "840"), ..., } This brings the need of another structure, to map the original currency string to the invented ones, something like { ..., "USD":("AS-USD", "IO-USD", "US-USD"), ...} I have issues with the three structures proposed so far: 1. Mine: Clearly wrong! The currency string is repeated and we can not use it as a dictionary key. 2. Darek's: Don't like the not-flat property 3. Jeff's: Brings another layer of complexity: How do you choose (as a developer) and how do you predict (as user) the inserted two letters? Before chosing one, keeping proposing others, or discuss the actual ones, I think that we must focus in specifying what we need: 1. What information we want in the structure (or structures) 2. The standard source of that information 3. How we want to access that information Then, we could specify the structure/s that we'll use. So, start shooting! :) Regards, . Facundo Blog: http://www.taniquetil.com.ar/plog/ PyAr: http://www.python.org/ar/ |