Skip to content

API Reference parrot_formdesigner.core._location_data

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot_formdesigner.core._location_data

View source

Offline country reference data via pycountry.

Wraps pycountry to provide helpers used by the LOCATION field type validator and JSON Schema extractor. No network calls — all data is bundled with the pycountry package.

If pycountry is not installed, functions degrade gracefully:

  • is_valid_iso_country_code returns True (validation skipped).
  • get_country_info returns None.
  • list_country_options returns an empty list.

Alias FieldOption

Re-exported from parrot_formdesigner.core.options.FieldOption.

Function get_country_info

Return name, flag emoji, and dial code for a country code.

get_country_info(code: str) -> dict | None

Parameter Type Default Description
code str ISO 3166-1 alpha-2 country code.

Returns: dict | None — Dict with keys 'name', 'flag', 'dial_code', or None if not found or if pycountry is not installed.

Function is_valid_iso_country_code

Return True if code is a valid ISO 3166-1 alpha-2 country code.

is_valid_iso_country_code(code: str) -> bool

Parameter Type Default Description
code str Two-letter country code (case-insensitive).

Returns: bool — True if valid, False otherwise. Returns True if pycountry is not installed.

Function list_country_options

Return all countries as a FieldOption list sorted by name.

list_country_options() -> list[FieldOption]

Returns: list[FieldOption] — List of FieldOption with value=alpha_2, label=name, icon=flag emoji. Returns an empty list if pycountry is not installed.

Attribute logger

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally