Skip to content

Instantly share code, notes, and snippets.

@thevickypedia
Created February 24, 2021 23:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thevickypedia/c0dd4d2467082a4bab37f012b81502b8 to your computer and use it in GitHub Desktop.
Save thevickypedia/c0dd4d2467082a4bab37f012b81502b8 to your computer and use it in GitHub Desktop.
from phonenumbers import geocoder, carrier, parse, timezone, is_valid_number, is_possible_number
phone = parse('target number goes here')
if is_valid_number(phone) and is_possible_number(phone):
state = geocoder.description_for_number(phone, 'en')
t_zone = timezone.time_zones_for_number(phone)[0]
car = carrier.name_for_number(phone, 'en')
print(f'The phone number with {phone} using the Carrier {car} is located in {state} and is currently in the timezone {t_zone}.')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment