When to use Internacia
Use this repository when you need stable reference data for:
- ISO 3166-1 identifiers (alpha-2 / alpha-3 / numeric) and entity status (
code_status) - Borders (neighbors stored as ISO alpha-3 codes)
- International organization / treaty membership rosters (“intblocks”), including reliable join keys
- Entity linking (multilingual names/aliases + Wikidata IDs)
- Transit structure: route roles on pipelines and corridors (
includes[].role) and closed or restricted land borders (border_status,country_borders) - Institutional design of organizations (
institutional_design: decision rule, binding force, enforcement, vetoes) for a reviewed cohort, to tell binding institutions from forums and technical bodies
Do not use Internacia for socioeconomic or time-series analytics:
- HDI, GDP, government type, internet penetration
- military spending, armed-forces size, composite power or influence scores
- bilateral trade values, shares or balances, transit volumes, route capacity
- governance scores, macro time-series indicators
If your task needs those, enrich with a separate dataset and treat Internacia as a join-key hub.
Quick decision guide (LLM-friendly)
-
“Find a country by ISO code / Wikidata ID”
Use Internacia: lookups are deterministic and include remaps + aliases. -
“List members of NATO / EU / UN”
Use Internacia: querymemberships(DuckDB) and filter onstatusfor current members.client.intblocks.get_by_member(...)in SDK 0.2.x also returns former memberships. -
“Neighbors of Germany / land border lookup”
Use Internacia:countries.bordersstores ISO alpha-3 neighbor codes; join oncountries.iso3code. -
“Fuzzy match messy names (multilingual)”
Use Internacia names in DuckDB (SQL recipe).client.search.fuzzy(...)is broken in SDK 0.2.x on data v3. -
“Time-varying facts (GDP by year, HDI series, etc.)”
Internacia is not an indicator time-series dataset. Membership history is in scope:includes[].joined/includes[].leftand themembershipstable record when a country joined or left an organization. Use those for former-member questions; do not expect annual GDP or governance scores.
Gotchas to bake into generated code
- Intblock membership joins use
includes[].id(authoritative).includes[].nameis just a label. bordersuses ISO alpha-3 codes (iso3code), not alpha-2 (code).- If you join across releases, prefer stable IDs and apply alias remaps:
data/datasets/intblocks_aliases.jsondata/datasets/countries_aliases.json
Canonical entry points
DuckDB (works on every current release; download internacia.duckdb from the
latest GitHub Release):
SELECT code, iso3code, name FROM countries WHERE code = 'US';
SELECT i.id, i.name, m.status, m.joined
FROM memberships m
JOIN intblocks i ON i.id = m.intblock_id
WHERE m.country_code = 'US'
AND m.status IN ('member', 'founding_member')
ORDER BY i.id;
Python SDK: internacia 0.2.x on PyPI predates data v3. It cannot download
current releases, search.fuzzy fails, and get_by_member includes former
memberships — see SDK status. With a downloaded
DuckDB file, the basic lookups still work:
from pathlib import Path
from internacia import InternaciaClient
client = InternaciaClient(db_path=Path("internacia.duckdb"))
country = client.countries.get_by_code("US")