Closed willemstuursma closed 6 years ago
While this would be an accurate and welcome addition, I am not sure how to deal with the fact that there is no temporary alpha3 code nor a temporary numerical code, making the dataset rather incomplete.
Yes it's a bit tricky.
How about this approach: the reality seems to be that there is a valid alpha2 code and not a valid alpha3 or numerical code, so the library should reflect that.
It seems that the Kosovo passport uses RKS
as the alpha-3 code.
Hmm, I would argue that is probably best to keep it out of the library, as it is not officially part of the ISO 3166-1 standard. At this point in time, theoretically everyone can implement it as they wish. In practice, I have seen it being assigned the same numeric code as Serbia.
Interesting comment about it here: https://github.com/mledoze/countries/issues/126#issuecomment-76139418
In my opinion, the safest bet is to leave it to the users of this library to interpret XK
the way they need to. It is a so-called user-assigned code element (see https://en.wikipedia.org/wiki/ISO_3166-1#Reserved_and_user-assigned_code_elements). So, if Kosovo is at some point officially added to the standard, it will probably not keep using that alpha-2 code.
Also, in practical terms, you could simply decorate or wrap my class and override the relevant methods where you want to return additional, new and/or different data when given specific input value(s).
For now, I will not be adding it until it becomes fully official.
As an option https://geonames.wordpress.com/2010/03/08/xk-country-code-for-kosovo/ states “If users need code elements to represent country names not included in this part of ISO 3166, the series of letters AA, QM to QZ, XA to XZ, and ZZ, and the series AAA to AAZ, QMA to QZZ, XAA to XZZ, and ZZA to ZZZ respectively and the series of numbers 900 to 999 are available.”
This may give us a valid way to add the codes, then update them when the codes are officially added.
From Wikipedia: