AgentStack
SKILL verified MIT Self-run

Add Iso3166

skill-danielrosehill-claude-data-wrangler-plugin-add-iso3166 · by danielrosehill

Add ISO 3166 country codes (alpha-2, alpha-3, numeric) to a dataset that references countries by name but lacks standardised codes. Use when the user has a CSV/JSON/Parquet/Excel dataset with country names and wants ISO 3166 codes added as new columns/fields.

No reviews yet
0 installs
15 views
0.0% view→install

Install

$ agentstack add skill-danielrosehill-claude-data-wrangler-plugin-add-iso3166

✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

Are you the author of Add Iso3166? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Add ISO 3166 Country Codes

Add ISO 3166-1 codes to a dataset whose country column contains plain names.

When to invoke

  • Dataset has a country column (named country, nation, country_name, or similar) but no ISO code column.
  • User asks to "add country codes", "add ISO codes", "enrich with ISO 3166".

Procedure

  1. Locate the dataset — confirm file path and format (CSV, JSON, JSONL, Parquet, XLSX).
  2. Identify the country column — if multiple candidates exist or the column is ambiguous, ask the user which column holds the country name.
  3. Check for pre-existing codes — if an ISO column already exists, report and ask whether to overwrite or skip.
  4. Load data with pandas (pd.read_csv, pd.read_json, pd.read_parquet, pd.read_excel).
  5. Resolve country names to ISO codes using pycountry:
  • Try exact match first via pycountry.countries.get(name=...) and .lookup(...).
  • For fuzzy/partial matches, use pycountry.countries.search_fuzzy(...) with a confidence threshold.
  • Common aliases to hard-code before fuzzy matching: USA/U.S./U.S.A.United States, UKUnited Kingdom, RussiaRussian Federation, South KoreaKorea, Republic of, North KoreaKorea, Democratic People's Republic of, Ivory CoastCôte d'Ivoire, Czech RepublicCzechia, BurmaMyanmar.
  1. Add columns: iso3166_alpha2, iso3166_alpha3, iso3166_numeric. Ask the user if they want all three or a subset — default to all three.
  2. Report unresolved rows — list every country value that could not be mapped, with row counts. Do not silently drop or leave blank without reporting.
  3. Write output — save alongside the input with _iso3166 suffix by default (e.g. countries.csvcountries_iso3166.csv), preserving the input format. Confirm path with user if ambiguous.
  4. Update the data dictionary — if a data dictionary exists in the same folder (see add-data-dictionary / update-data-dictionary skills), add the new columns. If none exists, offer to create one.

Dependencies

pip install pandas pycountry openpyxl pyarrow

Edge cases

  • Subnational regions (e.g. "Scotland", "Catalonia") — flag and ask user whether to map to parent country or leave blank.
  • Historical entities ("USSR", "Yugoslavia", "Czechoslovakia") — ISO 3166-3 covers these; offer that as an option.
  • Multi-country rows (e.g. "Germany / France") — flag and ask user how to handle (split, skip, keep first).
  • Empty / null country values — leave ISO columns null; report count.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet — be the first.

Versions

  • v0.1.0 Imported from the upstream source.