countrynormalizer 0.1.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -237,6 +237,34 @@ This function returns a trimmed down set of country data for each country on the
237
237
 
238
238
  If you need absolutely all information about every country on a continent use the `findAllMatchedCountries()` function with a continent entered.
239
239
 
240
+ ### List All Countries:
241
+
242
+ You can call `getAllCountries()` to return the complete countries data set. The response is properly typed so it should be decently easy to work with.
243
+
244
+ This is a massive array of objects for every country on Earth contained in the ISO 3166 list.
245
+
246
+ This may be helpful for understanding the data shapes, visualizing all the data, or shaping information in ways the package functions/APIs do not support natively.
247
+
248
+ ## Data Sources:
249
+ This data is compiled from a wide array of sources. To give transparency to this I want to document the primary source or reason for each field.
250
+
251
+ * common_reference: This is a field made up by me as the publisher. This is how people might "commonly refer to a country" in conversation. The full name of Iran formally is "Iran, Islamic Republic of" but most people just say "Iran." That is the idea behind this field. Easily lookup how most English speakers would refer to a country.
252
+ * english_clean: This comes off of the "country name using title case" column on the wikipedia Alpha 2 documentation for ISO 3166: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
253
+ * formal_order: On Wikipedia and other sources for easy Alpabetization they order countries by common names. So "Netherlands, Kingdom of the", this just puts it in order as "Kingdom of the Netherlands."
254
+ * alpha_2: ISO 3166 Alpha 2 values as listed on wikipedia: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
255
+ * alpha_3: Taken from Wikipedia ISO 3166 master table: https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes
256
+ * num_code: Taken from Wikipedia ISO 3166 master table: https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes
257
+ * demonym_male: ChatGTP deep research compiled CSV dataset asking it to align ISO Alpha 3 codes to demonym by country for both male and female.
258
+ * demonym_female: ChatGTP deep research compiled CSV dataset asking it to align ISO Alpha 3 codes to demonym by country for both male and female.
259
+ * gendered_demonym: Manual alignment in Google Sheet by me comparing `demonym_male` and `demonym_male` for string differences and setting a boolean.
260
+ * tld: Taken from Wikipedia ISO 3166 master table: https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes
261
+ * flag_emoji: Used table available on Flagepedia and then cleaned up the data for easy usage in CSVs and JSON objects: https://flagpedia.net/emoji
262
+ * calling_code: ChatGPT compiled deep research task. Instructed to rely primarily on these data sources to make data easily worked with in a CSV and as JSON objects.
263
+ * * https://en.wikipedia.org/wiki/Trunk_prefix
264
+ * * https://en.wikipedia.org/wiki/List_of_telephone_country_codes
265
+ * * https://www.countrycode.org/
266
+ * continent: ChatGPT deep research compiled list asking to align all ISO Alpha 3 country codes to their continent.
267
+
240
268
  ## To-Do List:
241
269
  This package was started as part of language classification and news analytics projects I'm working on in my personal time.
242
270
 
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { findCountryByUnique, findAllMatchedCountries } from "./src/findCountryByUnqiue";
2
2
  import { getContactFieldsByAlpha2 } from "./src/getCountryContactData";
3
3
  import { getCountriesByContinent } from "./src/getCountriesByContinent";
4
+ import { getAllCountries } from "./src/getAllCountries";
4
5
  import type { AllCountryFields, ContactCountryFields, ContinentNames, ContinentTrimmedFields } from "./types/core";
5
- export { findCountryByUnique, findAllMatchedCountries, getContactFieldsByAlpha2, getCountriesByContinent, };
6
+ export { findCountryByUnique, findAllMatchedCountries, getContactFieldsByAlpha2, getCountriesByContinent, getAllCountries, };
6
7
  export type { AllCountryFields, ContactCountryFields, ContinentNames, ContinentTrimmedFields, };