dr5hn / countries-states-cities-database

🌍 Discover our global repository of countries, states, and cities! 🏙️ Get comprehensive data in JSON, SQL, PSQL, XML, YAML, and CSV formats. Access ISO2, ISO3 codes, country code, capital, native language, timezones (for countries), and more. #countries #states #cities
https://dr5hn.github.io/countries-states-cities-database/
Open Data Commons Open Database License v1.0
6.82k stars 2.45k forks source link

Request for feedback - United States IRS Country Codes #726

Open KennethScott opened 7 months ago

KennethScott commented 7 months ago

Would there be any interest in incorporating the United States Internal Revenue Service (IRS) Country Codes into this project?

If you've ever worked in Banking, Finance, Accounting, Investments, etc. you know the joy of how the IRS uses their own (outdated) 2-character country codes that are a little different from the ISO2 codes.

Reference

I'm curious if there would be any interest in trying to incorporate that data into this project. Sadly there's not a one-to-one between the codes to allow for easy translation. Probably 80% are the same as the ISO, but the ones that aren't are a pain. Besides some countries simply having a different 2 character code, there are other fun scenarios such as:

Just all sorts of fun little edge cases like that... The unfortunate thing is I don't think you could simply add the IRS code as another attribute on the ISO2 entry because it's not one-to-one. You'd have 3 IRS codes for Australia, 9 IRS codes for United States, etc. I am guessing you'd have to have a dedicated IRS country code table that you could map back to the ISO entries.

Here's a gist where I've mapped them if you want to see more details.

I'm curious what others think/if there's any interest.

Thanks-