"""Constants for the OECD provider. Country resolution is handled dynamically by OecdMetadata.resolve_country_codes() using the REF_AREA codelist from each dataflow's DSD. """ # Frequency mapping: user-friendly name -> SDMX code FREQUENCY_MAP: dict[str, str] = { "annual": "A", "yearly": "A", "quarter": "Q", "quarterly": "Q", "month": "M", "monthly": "M", "week": "W", "weekly": "W", "day": "D", "daily": "D", } FREQUENCY_MAP_REV: dict[str, str] = { v: k for k, v in FREQUENCY_MAP.items() if k == v.lower() or k in ("annual", "quarterly", "monthly", "weekly", "daily") } # Canonical frequency labels for reverse lookup (code -> label) FREQUENCY_LABELS: dict[str, str] = { "A": "annual", "Q": "quarterly", "M": "monthly", "W": "weekly", "D": "daily", } # Well-known dataflow aliases for user convenience. # Keys are short aliases; values are the dataflow short IDs. DATAFLOW_ALIASES: dict[str, str] = { "CPI": "DF_PRICES_ALL", "CLI": "DF_CLI", "KEI": "DF_KEI", "GDP": "DF_QNA", "GDP_NOMINAL": "DF_QNA_EXPENDITURE_CAPITA", "GDP_FORECAST": "DF_EO", "UNEMPLOYMENT": "DF_IALFS_UNE_M", "HPI": "DF_RHPI_TARGET", "SHARES": "DF_FINMARK", "BOP": "DF_BOP", "NAAG": "DF_NAAG_I", } # --- Constrained country lists per dataflow --- # Sourced from OECD SDMX availability constraints (fetch_availability). # These are the actual REF_AREA values that have data in each dataflow, # NOT the full codelist (which has 500+ entries including non-existent ones). CPI_COUNTRIES: tuple[str, ...] = ( "argentina", "australia", "austria", "belgium", "brazil", "bulgaria", "canada", "chile", "china", "colombia", "costa_rica", "croatia", "czechia", "denmark", "estonia", "eu27", "euro_area_20_countries", "finland", "france", "g20", "g7", "germany", "greece", "hungary", "iceland", "india", "indonesia", "ireland", "israel", "italy", "japan", "korea", "latvia", "lithuania", "luxembourg", "mexico", "netherlands", "new_zealand", "norway", "oecd", "oecd_europe", "poland", "portugal", "romania", "russia", "saudi_arabia", "slovak_republic", "slovenia", "south_africa", "spain", "sweden", "switzerland", "turkiye", "united_kingdom", "united_states", ) GDP_REAL_COUNTRIES: tuple[str, ...] = ( "argentina", "australia", "austria", "belgium", "brazil", "bulgaria", "canada", "chile", "china", "colombia", "costa_rica", "croatia", "czechia", "denmark", "estonia", "eu15", "eu27", "euro_area_20_countries", "finland", "france", "g20", "g7", "germany", "greece", "hungary", "iceland", "india", "indonesia", "ireland", "israel", "italy", "japan", "korea", "latvia", "lithuania", "luxembourg", "mexico", "netherlands", "new_zealand", "norway", "oecd", "oecd_26_countries", "oecd_europe", "poland", "portugal", "romania", "russia", "saudi_arabia", "slovak_republic", "slovenia", "south_africa", "spain", "sweden", "switzerland", "turkiye", "united_kingdom", "united_states", "usmca", ) GDP_FORECAST_COUNTRIES: tuple[str, ...] = ( "argentina", "australia", "austria", "belgium", "brazil", "bulgaria", "canada", "chile", "china", "colombia", "costa_rica", "croatia", "czechia", "dae", "denmark", "estonia", "eu22_oecd", "euro_area_17_countries", "finland", "former_ussr", "france", "germany", "greece", "hungary", "iceland", "india", "indonesia", "ireland", "israel", "italy", "japan", "korea", "latvia", "lithuania", "luxembourg", "mexico", "nafta", "netherlands", "new_zealand", "non_oecd_economies", "norway", "oecd", "oecd_asia_oceania", "opec", "other_countries", "other_major_oil", "other_oil_producers", "peru", "poland", "portugal", "rest_of_world", "romania", "russia", "slovak_republic", "slovenia", "south_africa", "spain", "sweden", "switzerland", "thailand", "turkiye", "united_kingdom", "united_states", "world", ) KEI_COUNTRIES: tuple[str, ...] = ( "argentina", "australia", "austria", "belgium", "brazil", "canada", "chile", "china", "colombia", "costa_rica", "croatia", "czechia", "denmark", "estonia", "eu27", "euro_area", "euro_area_19_countries", "euro_area_20_countries", "finland", "france", "g20", "g7", "germany", "greece", "hungary", "iceland", "india", "indonesia", "ireland", "israel", "italy", "japan", "korea", "latvia", "lithuania", "luxembourg", "mexico", "netherlands", "new_zealand", "norway", "oecd", "oecd_europe", "poland", "portugal", "russia", "saudi_arabia", "slovak_republic", "slovenia", "south_africa", "spain", "sweden", "switzerland", "turkiye", "united_kingdom", "united_states", ) CLI_COUNTRIES: tuple[str, ...] = ( "asia5", "australia", "austria", "belgium", "brazil", "bulgaria", "canada", "chile", "china", "colombia", "costa_rica", "croatia", "czechia", "denmark", "estonia", "eu27", "euro_area_19_countries", "euro_area_20_countries", "europe4", "finland", "france", "g20", "g7", "germany", "greece", "hungary", "india", "indonesia", "ireland", "israel", "italy", "japan", "korea", "latvia", "lithuania", "luxembourg", "mexico", "nafta", "netherlands", "new_zealand", "norway", "oecd", "oecd_europe", "oecd_non_euro_area", "poland", "portugal", "romania", "russia", "slovak_republic", "slovenia", "south_africa", "spain", "sweden", "switzerland", "turkiye", "united_kingdom", "united_states", ) UNEMPLOYMENT_COUNTRIES: tuple[str, ...] = ( "australia", "austria", "belgium", "bulgaria", "canada", "chile", "colombia", "costa_rica", "croatia", "czechia", "denmark", "estonia", "eu27", "euro_area", "finland", "france", "g7", "germany", "greece", "hungary", "iceland", "ireland", "israel", "italy", "japan", "korea", "latvia", "lithuania", "luxembourg", "mexico", "netherlands", "new_zealand", "norway", "oecd", "poland", "portugal", "romania", "slovak_republic", "slovenia", "spain", "sweden", "switzerland", "turkiye", "united_kingdom", "united_states", ) RHPI_COUNTRIES: tuple[str, ...] = ( "australia", "austria", "belgium", "brazil", "bulgaria", "canada", "chile", "china", "colombia", "croatia", "czechia", "denmark", "estonia", "eu_27", "euro_area_20_countries", "finland", "france", "germany", "greece", "hungary", "iceland", "india", "indonesia", "ireland", "israel", "italy", "japan", "korea", "latvia", "lithuania", "luxembourg", "mexico", "netherlands", "new_zealand", "norway", "poland", "portugal", "russia", "saudi_arabia", "slovak_republic", "slovenia", "south_africa", "spain", "sweden", "switzerland", "turkiye", "united_kingdom", "united_states", ) BOP_COUNTRIES: tuple[str, ...] = ( "argentina", "australia", "austria", "belgium", "brazil", "canada", "chile", "china", "colombia", "costa_rica", "czechia", "denmark", "estonia", "euro_area_20_countries", "eu27", "finland", "france", "g20", "g7", "germany", "greece", "hungary", "iceland", "india", "indonesia", "ireland", "israel", "italy", "japan", "korea", "latvia", "lithuania", "luxembourg", "mexico", "netherlands", "new_zealand", "norway", "oecd", "poland", "portugal", "russia", "saudi_arabia", "slovak_republic", "slovenia", "south_africa", "spain", "sweden", "switzerland", "turkiye", "united_kingdom", "united_states", ) FINMARK_COUNTRIES: tuple[str, ...] = ( "argentina", "australia", "austria", "belgium", "brazil", "bulgaria", "canada", "chile", "china", "colombia", "costa_rica", "croatia", "czechia", "denmark", "estonia", "euro_area_19_countries", "euro_area_20_countries", "finland", "france", "germany", "greece", "hungary", "iceland", "india", "indonesia", "ireland", "israel", "italy", "japan", "korea", "latvia", "lithuania", "luxembourg", "mexico", "netherlands", "new_zealand", "norway", "poland", "portugal", "romania", "russia", "saudi_arabia", "sdr", "slovak_republic", "slovenia", "south_africa", "spain", "sweden", "switzerland", "turkiye", "united_kingdom", "united_states", )