Questions tagged [python-phonenumber]

Python port of Google's libphonenumber library.

Python port of Google's libphonenumber library.

18 questions
3
votes
1 answer

Populating Country column from international phone numbers

I have a dataframe with several data including the column phone. I would like to create a column name country, based on the phone numbers. The phone numbers are in the format +country_code_phonenumber, i.e.,for several…
Jorge Gomes
  • 304
  • 2
  • 15
2
votes
1 answer

How can I use the python-phonenumbers library to check the type of phone number?

How can we use the python-phonenumbers library to determine whether a particular phone number is a mobile number or landline number?
Shamil Jamion
  • 183
  • 10
1
vote
1 answer

How can I customise error messages shown by PyInputPlus?

How can I customise error messages shown by PyInputPlus in python? I have tried many method but unable to do it. import pyinputplus as pyip number = pyip.inputNum("Enter your phone number : ", min=1000000000, …
Akash Kumar
  • 540
  • 2
  • 4
  • 15
1
vote
2 answers

Parsing exception in Phone Number library in python

I am having Mobile numbers in below format with no "+" sign in front of mobile numbers. How to get country from these format of numbers. I checked documentation,"+" sign is required. Any way to add '+' sign manually before it check for number to…
Divyank
  • 811
  • 2
  • 10
  • 26
1
vote
2 answers

Trying to e.164 a phone number from form input

I'm trying to take a UK mobile phone number input from a web form and use Python to clean it into a E.164 format, then validate it, before entering it into a database. The library I'm trying to use is "Phonenumbers" and the code I'm experimenting…
1
vote
1 answer

PYTHON CONVERT INT into PHONE NUMBER

I'm trying to import an excel file into my django project and create a Client object with the excel's data. this is my Client model: class Client(models.Model): client = models.CharField(max_length=255, null=False) name =…
0
votes
0 answers

E.123 Format Phone number in python based on country

I am trying to format phone numbers using https://pypi.org/project/phonenumbers/ It is working. But is there a way I could verify if this would comply E.123/E.164 formatting ? Appreciate any…
NinjaBat
  • 370
  • 4
  • 20
0
votes
1 answer

Python phonenumbers: how to get the required number of digits of a mobile phone in a country?

I want to use python phonenumbers to get the number of digits that mobile phones have to have for each country. I'm importing the phonenumbers/libphonenumber library. I tried fetching the metadata with no success. Then I tried fetching an example…
0
votes
1 answer

This program is for giving the carrier and the country of a specific number , but it's just return the carrier without country

there is the code : import phonenumbers from phonenumbers import geocoder number = input("enter the number : ") ch_number = phonenumbers.parse(number, "CH") print(geocoder.description_for_number(ch_number, "english")) from phonenumbers import…
0
votes
2 answers

How to use phonenumbers Python library on a pandas dataframe testing phone field before?

I would to parse a phone field in a pandas dataframe. My phone field is named Phone and my country code field CountryCode. It works but only when all the phones are filled: df['Test phone'] = df.apply(lambda x:phonenumbers.parse(str(x['Phone']),…
Georgie
  • 108
  • 11
0
votes
2 answers

Separate national and international phone numbers that are not formatted

i'm working on my first "big" project, and i basically need to deal with a lot of phone numbers, like, extracting them from a file (already done), formatting them to the same format (problem is here) and lastly store them in a database (also already…
0
votes
3 answers

country_name_for_number in phonenumbers returns nothing

I want to access the country name using a phone number with Python. But for some input data it does not return anything, how can I fix this? In the Phonenumbers documentation, I spotted the following suspicious comment: If the number has already…
0
votes
0 answers

botocore.exceptions.ParamValidationError: Parameter validation failed:

I use django-rest-sms-auth, which provides such providers as Twilio, Megafon, smsaero. But I've created another provider - Amazon SNS. def send_amazon_sms(self): client = boto3.client('sns',…
0
votes
1 answer

python geocoder for australian number not working

I tried to get the geolocation coordinates of my mobile/cell phone number, I used phonenumbers and geocoder. the number information and carrier info came out good. but the location and region info are blank in the output. When I tried US numbers,…
Jesscralett
  • 41
  • 10
0
votes
1 answer

"The string supplied did not seem to be a phone number" phonenumbers modual

I'm trying to figure out what I'm doing wrong, I keep getting the error message The string supplied did not seem to be a phone number I'm trying to make a little app that does a lot of things with phone numbers like give the location and stuff…
1
2