{"library":"phone-iso3166","title":"phone-iso3166","description":"A Python library that maps phone numbers (E.164 format) to their corresponding country codes (ISO 3166-1 alpha-2). Version 0.4.1 provides a simple `CountryCodeResolver` class and a convenience function `phone_country`. Lightweight with no external dependencies.","language":"python","status":"active","last_verified":"Fri May 01","install":{"commands":["pip install phone-iso3166"],"cli":null},"imports":["from phone_iso3166 import country_code","from phone_iso3166 import CountryCodeResolver"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from phone_iso3166 import country_code\n\n# Example with a valid US number\nphone = '+14155552671'\ncode = country_code(phone)\nprint(code)  # Output: US\n\n# Example with a UK number\nphone2 = '+442071838750'\ncode2 = country_code(phone2)\nprint(code2)  # Output: GB","lang":"python","description":"Import the `country_code` function and pass an E.164 formatted phone number (string with leading +). Returns ISO 3166-1 alpha-2 country code or None if not found.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}