skillfed

phone-iso3166

Phonenumber to Country (ISO 3166-1) mapping

phone-iso3166 v0.4.1 126.9K downloads/30d#11,759 on PyPI
Permissive license MIT Abandoned released

What it is and what it does

Phone-ISO3166 is a lightweight, dependency-free library that converts international phone numbers (E.164 format) and mobile network codes (E.212 format) into ISO 3166-1 alpha-2 country codes. It also provides reverse lookups to find network operators by country. The package is designed for simple, direct mapping—it does not attempt to parse or validate phone numbers in various formats; it assumes input is already in a standardized form.

The library is useful when you need to determine a phone number's country of origin or find which mobile operator serves a given network code. It works by looking up the phone number prefix or network code pair against built-in reference tables. For fuzzy or locale-specific phone number parsing, the description suggests pairing it with external packages like phonenumbers or pycountry.

Use it for:

  • Determine the country of origin for an international phone number in E.164 format.
  • Look up the mobile network operator name and country for a given MCC (mobile country code) and MNC (mobile network code) pair.
  • Reverse-lookup all mobile operators in a specific country by ISO country code.
  • Enrich phone number data with country information for analytics or routing workflows.
  • Validate or categorize incoming calls by their country of origin.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Maps international phone numbers and mobile network codes to ISO 3166-1 alpha-2 country codes, with optional lookup of network operator names.

No. The package is abandoned (no maintenance for 1457 days) with outdated Python classifiers and an unverified claim of Python 3.6+ support. While it has no dependencies and a permissive license, the stale reference data and lack of maintenance make it risky for production use. For active alternatives or a maintained fork, check the repository or consider phonenumbers + pycountry.

Install

phone-iso3166 on PyPI

pip

pip install phone-iso3166

uv

uv add phone-iso3166

poetry

poetry add phone-iso3166

Installing phone-iso3166

Before you install

Low install friction with no runtime dependencies. However, the package is abandoned—last release was 1457 days ago with no maintenance activity. The classifiers list Python 2.7 and 3.3–3.5, which are all end-of-life; current Python support is unspecified.

License in practice

MIT license (permissive) means you can use, modify, and distribute this package freely with minimal restrictions, provided you retain the license notice.

Quickstart

pip install phone-iso3166

from phone_iso3166.country import phone_country
phone_country('+1 202-456-1111')  # Returns 'US'

from phone_iso3166.network import network
network(238, 1)  # Returns ('DK', 'TDC Mobil')

The package declares support for Python 3.6+ in its description, but classifiers only list up to 3.5; actual compatibility with modern Python versions is unverified.

Verify before relying

  • Whether the package actually works on Python 3.6+ and PyPy 3.6+ as claimed in the description, given the outdated classifiers.
  • Whether the phone number and network code databases are current or stale after 1457 days without maintenance.
  • Whether there are known issues or breaking changes in the latest release that the abandoned status might mask.

Package facts

License MIT (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance abandoned — 1,457 days since the last release
First released
Downloads 126,879/month — #11,759 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: phone_iso3166-0.4.1-py3-none-any.whl

Keywords: phone, country, mobile, iso3166, e164, e212, countrycode, phonenumber

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishProgramming Language :: PythonProgramming Language :: Python :: 2.7Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5

Tags

phone number to country codeE.164 phone number mappingmobile network code lookupISO 3166 country from phoneinternational phone country detectionE.212 MCC MNC to countryphone number geolocation
phone-numbergeolocationreference-data

More Utilities packages