The purpose of this app is to validate phone numbers based on the user input of csv file or a single phonenumber.
For a given country (e.g., South Africa), a list of telephone numbers will be given by user.
This app will be doing the below tasks -
● Consume the provided file via any of the following means eg. upload from a browser / console call / API.
● Test each number and check for correctness, attempt to correct incorrectly formed numbers
and reject numbers that are invalid. (27831234567 is the correct format for this exercise).
● Store the results appropriately to Temporary File.
INPUT :
1.) A csv file with id and number fields for each entry. 2.) Individual Phone Number verification (service availble only via RestAPI)
OUTPUT: 1.) Display results by the following means
a. Acceptable numbers
b. Corrected numbers
c. Invalid numbers
2.) Validate the individual number whether or not the number is valid
A.) MongoDB Server B.) pip install following packages
Flask==1.0.2
Flask-HTTPAuth==3.2.4
Flask-PyMongo==2.2.0
pymongo==3.7.2
phonenumbers==8.10.2
Start the MongoDB Demon and service. From terminal execute server.py. This will start the web service at 127.0.0.1 on port 5000.
To access the service via use below api -
curl -i -u admin:nopass -X POST localhost:5000/phnumbers/upload -F file=@data.csv.
curl -i -u admin:nopass -X GET localhost:5000/phnumbers/file_status/valid_numbers.csv.
curl -i -u admin:nopass -X GET localhost:5000/phnumbers/status/27717278645.
Using a Webbrowser type following url-
127.0.0.1:5000.
status: In progress
- test_number_validation.py
- Flask - The web framework
- MongoDB - Phonenember Parsing.
- PyMongo - DB Connector
- PhoneNumbers - Phonenember Parsing.
- Tanmoy Roy - Initial work - github
- Thanks to everyone whose code was used