Get Phone Number Information using Python Last Updated : 16 Jul, 2020 Comments Improve Suggest changes Like Article Like Report In this article, you will learn how you can get the information about phone number like the country name to which the phone number belongs to, or the network service provider name of that phone number just by writing a simple Python program. Python provides a module name phonenumbers for this task. This article is Python's port of Google's libphonenumber library. Installation Install the package phonenumbers using the below command in your command prompt. pip install phonenumbers Example 1: Python program to get the country name to which phone number belongs: Python3 import phonenumbers # geocoder: to know the specific # location to that phone number from phonenumbers import geocoder phone_number = phonenumbers.parse("Number with country code") # Indian phone number example: +91********** # Nepali phone number example: +977********** # this will print the country name print(geocoder.description_for_number(phone_number, 'en')) Output: India Example 2: Python program to get the service provider name to that phone number Python3 import phonenumbers # carrier: to know the name of # service provider of that phone number from phonenumbers import carrier service_provider = phonenumbers.parse("Number with country code") # Indian phone number example: +91********** # Nepali phone number example: +977********** # this will print the service provider name print(carrier.name_for_number(service_provider, 'en')) Output: Airtel Comment More infoAdvertise with us Next Article Get Phone Number Information using Python M mkumarchaudhary06 Follow Improve Article Tags : Python python-utility Python-projects Practice Tags : python Similar Reads How to generate a random phone number using Python? In this article, we will learn how to generate a random phone number using Python. In general, Indian phone numbers are of 10 digits and start with 9, 8, 7, or 6. Approach: We will use the random library to generate random numbers.The number should contain 10 digits.The first digit should start with 1 min read Format a Number Width in Python Formatting numbers to a fixed width is a common requirement in various programming tasks, especially when dealing with data presentation or storage. By understanding these techniques, developers can ensure consistent and visually appealing formatting of numerical data in their Python. Format a Numbe 3 min read Get Country From Phone Number - Python This article will teach you how to use Python to determine the country of a phone number using Python. How to Get Country From Phone Number in Python using Phonenumbers Module The phonenumbers module is a python package that can be used to find the country corresponding to a phone number based on it 2 min read Python Modulo String Formatting In Python, a string of required formatting can be achieved by different methods. Some of them are; 1) Using % 2) Using {} 3) Using Template Strings In this article the formatting using % is discussed. The formatting using % is similar to that of 'printf' in C programming language. %d - integer %f - 2 min read Get OS name and version in Python Python programming has several modules that can be used to retrieve information about the current operating system and the version that is running on the system. In this article we will explore How to get the OS name and version in Python.Let us see a simple example to get the OS name and version in 2 min read Like