Closed jerinpetergeorge closed 9 months ago
This packages relies on libphonenumber. Phone numbers aren’t just digits put together, they have a structure. In the US, the three first number correspond to an area, and many digits between 000 and 999 do not correspond to an area.
Your best bet is probably to use
>>> import phonenumbers
>>> phonenumbers.example_number(region_code='US')
PhoneNumber(country_code=1, national_number=2015550123, extension=None, italian_leading_zero=None, number_of_leading_zeros=None, country_code_source=0, preferred_domestic_carrier_code=None)
You can try modifying the last digits, they usually are the most local part of a phone number.
Also, libphonenumbers offers a phonenumbers.example_number_for_type()
method. You probably can rely on it to generate different valid phone numbers in a given region.
What is the best way to generate a list of US phone numbers, that should be valid per this package?
This is what I have tried,
Result