• Odisha

Anal New!: Julia Pais

# ---------------------------------------------------------------- # 4️⃣ Example usage # ---------------------------------------------------------------- if abspath(PROGRAM_FILE) == @__FILE__ # run only when this file is executed directly # Example: a tiny GDP table (USD per‑capita). In real life you would # load this from a CSV, an API, or a more complete dataset. sample_gdp = Dict( "FRA" => 41_463.0, "DEU" => 46_215.0, "JPN" => 40_247.0, "BRA" => 7_498.0, "USA" => 69_287.0 )

You can extend any of the steps (e.g., add more fields, plug in a different data source, or compute extra statistics). # -------------------------------------------------------------- # Country analysis feature for Julia # -------------------------------------------------------------- using HTTP using JSON3 using DataFrames # optional, only needed if you want tabular output using Statistics # for mean, median, etc. using Printf # for nice formatting

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

return CountryReport(info, density, gdp_per_capita, econ_weight) end

* `name_or_code` can be a common name (“France”), an ISO‑2 code (“FR”), or an ISO‑3 code (“FRA”). an ISO‑2 code (“FR”)

# ---------------------------------------------------------------- # 1️⃣ Data structures # ---------------------------------------------------------------- """ CountryInfo

# ---- 3️⃣ Compute derived metrics -------------------------------- density = info.area_km2 > 0 ? info.population / info.area_km2 : missing or an ISO‑3 code (“FRA”).

Returns a `CountryReport`. """ function analyze_country(name_or_code::AbstractString; gdp_table=nothing) # ---- 1️⃣ Pull the JSON payload --------------------------------- url = "https://restcountries.com/v3.1/name/" * HTTP.escapeuri(name_or_code) resp = HTTP.get(url; timeout=15)