File tree Expand file tree Collapse file tree 2 files changed +64
-0
lines changed Expand file tree Collapse file tree 2 files changed +64
-0
lines changed Original file line number Diff line number Diff line change
1
+ # pip install phonenumbers in cmd
2
+
3
+ # importing phonenumbers module
4
+ import phonenumbers
5
+
6
+ # calling timezone,geocoder and carrier from phonenumbers module
7
+ from phonenumbers import timezone ,geocoder ,carrier
8
+
9
+ # taking phone number as input from user
10
+ number = input ("Enter your number (with +91): " )
11
+
12
+ # parse the string input to phonenumber format
13
+ phone = phonenumbers .parse (number )
14
+
15
+ # to get the timezone of a user
16
+ time = timezone .time_zones_for_number (phone )
17
+
18
+ # Getting carrier of a phone number
19
+ car = carrier .name_for_number (phone ,"en" )
20
+
21
+ # Getting region information
22
+ reg = geocoder .description_for_number (phone ,"en" )
23
+
24
+ # printing the details
25
+ print ("Details :" )
26
+ print (phone )
27
+ print (time )
28
+ print (car )
29
+ print (reg )
Original file line number Diff line number Diff line change
1
+ # Phone Number Tracker
2
+
3
+ Phonenumbers package is used.
4
+ To import the phonenumbers package:
5
+ Open command prompt and type pip install phonenumbers.
6
+
7
+ The following modules are imported from phonenumbers package:
8
+ - geocoder: used to know the specific location to that phone number
9
+ - carrier: used to know the name of service provider of that phone number
10
+ - timezone: used to know the timezone
11
+
12
+ ## Setup instructions
13
+
14
+ - Clone the repo to your machine
15
+ - head over to the required(Phonenumber Tracker folder)
16
+ - Give the phone number with the country code at required places
17
+ - run the script
18
+
19
+ ## Detailed explanation of script, if needed
20
+
21
+ This is a phonenumber tracker that uses phonenumbers library to get the following details :
22
+ -country
23
+ -service provider of the phone number
24
+
25
+ ## Output
26
+
27
+ ![ image] ( https://github.com/Uma-95/Amazing-Python-Scripts/assets/99042417/23fcdd91-c864-486d-913c-675893cff6e8 )
28
+
29
+ ## Author
30
+
31
+ Uma Lamba
32
+
33
+ ## Disclaimers, if any
34
+
35
+ Do not forget to put the country code of the number that you provide.
You can’t perform that action at this time.
0 commit comments