Julia Pais Anal May 2026
# ---- 2️⃣ Build the CountryInfo struct --------------------------- info = CountryInfo( get(data["name"], "common", "unknown"), get(data["name"], "official", "unknown"), get(data, "cca2", "??"), get(data, "cca3", "???"), get(data, "population", 0), get(data, "area", 0.0), get(data, "capital", String[]), get(data, "region", "unknown"), get(data, "subregion", "unknown"), languages_from_dict(get(data, "languages", Dict())), currencies_from_dict(get(data, "currencies", Dict())), get(data["flags"], "png", "") )
println("\n--- Country analysis demo ------------------------------------------------\n") julia pais anal
# ---------------------------------------------------------------- # 1️⃣ Data structures # ---------------------------------------------------------------- """ CountryInfo we take the first match
A lightweight container for the most relevant pieces of information about a country. """ struct CountryInfo name::String # common name official_name::String # official name iso2::String # ISO‑3166‑1 alpha‑2 code iso3::String # ISO‑3166‑1 alpha‑3 code population::Int64 area_km2::Float64 capital::VectorString region::String subregion::String languages::VectorString currencies::VectorString flag_url::String end julia pais anal
data = JSON3.read(String(resp.body))[1] # REST Countries returns an array; we take the first match