Open RohitDhankar opened 4 years ago
Hi Rohit, Following is the code, today I will update the final code. I was busy with office stuff, so couldn't make it. xml_parser.txt
Hi Rohit, Following is the updated version of the code. Kindly suggest if any code changes needed.
Thanks & Regards, Abhijeet
1/ In a pandas DF - Check for phone numbers in a String 2/ If a valid Number extract the number and populate in a New Column of DF 3/ If no valid Number - then write "No_Valid_Tele" to the New Column 4/ Phone Numbers can be International Phone Numbers as an example an Austrian Number will start with Country Code = Austria (AT) countryCode=43 , while an Indian one with countryCode= 91. 5/ We need to extract Country code and then in a New Column of DF , provide the Country Code and Country Name
Phones Validation - re.compile("(0/91)?[7-9][0-9]{9}") https://pypi.org/project/phonenumbers/ https://stackoverflow.com/questions/15258708/python-trying-to-check-for-a-valid-phone-number https://stackoverflow.com/questions/16135069/python-validation-mobile-number
Don think there is a public dataset of phone numbers to test , for international numbers We can try this XML file and convert from XML to CSV file to create our own test data sets ... need to pick this from XML file == Austria (AT) countryCode=43 , and the Mobile numbers etc ... also given Regex Patterns in this XML file can be used .
https://github.com/daviddrysdale/python-phonenumbers/blob/dev/resources/PhoneNumberAlternateFormats.xml https://pypi.org/project/xmlutils/1.1/ http://blog.appliedinformaticsinc.com/how-to-parse-and-convert-xml-to-csv-using-python/