Perform basic validity checks on a string that is presumably an Australian phone number. Specifically, this package tell you whether the number exists and if it does, what telco it was allocated to.
Apart from the mobile numbers that start from 04, the following numbers are often in use in Australia:
These toll free numbers allow customers to reach a business without being charged for the call. Typically, 1800 numbers are free to call from landlines, but not from mobile phones.
These are so-called local call numbers that allow customers to call businesses at the cost of a local call. However, a mobile call is billed at a rate that is determined by their mobile service provider.
These are the same as the 1300 numbers.
We use the data by ACMA available here (a ~6 Mb zip file).
Currently, we simply use a Wikipedia page about telephone numbers in Australia.
pip3 install phonenumberchecker
pnc = PhoneNumberChecker()
pnc.verify('61401547982')
You get a tuple with a normalised version of the number and telco name (or ‘invalid’ if the number doesn’t exist):
('401547982', 'optus mobile')