phantomapi 1.0.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- PhantomAPI/__init__.py +6 -0
- PhantomAPI/core.py +37 -0
- PhantomAPI/provider.py +144 -0
- phantomapi-1.0.1.dist-info/METADATA +16 -0
- phantomapi-1.0.1.dist-info/RECORD +7 -0
- phantomapi-1.0.1.dist-info/WHEEL +5 -0
- phantomapi-1.0.1.dist-info/top_level.txt +1 -0
PhantomAPI/__init__.py
ADDED
PhantomAPI/core.py
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import re
|
|
2
|
+
from .provider import PROVIDERS
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class PhoneOSINT:
|
|
6
|
+
def __init__(self):
|
|
7
|
+
self.providers = PROVIDERS
|
|
8
|
+
|
|
9
|
+
def lookup(self, phone: str) -> dict:
|
|
10
|
+
phone = re.sub(r'[^0-9+]', '', phone)
|
|
11
|
+
|
|
12
|
+
for code, info in self.providers.items():
|
|
13
|
+
if phone.startswith(info['code']):
|
|
14
|
+
local_num = phone[len(info['code']):]
|
|
15
|
+
if not local_num.startswith('0') and code != 'SG':
|
|
16
|
+
local_num = '0' + local_num
|
|
17
|
+
|
|
18
|
+
prefixes = sorted(info['prefixes'].keys(), key=len, reverse=True)
|
|
19
|
+
for prefix in prefixes:
|
|
20
|
+
if local_num.startswith(prefix):
|
|
21
|
+
return {
|
|
22
|
+
'valid': True,
|
|
23
|
+
'number': phone,
|
|
24
|
+
'international': phone,
|
|
25
|
+
'country': info['name'],
|
|
26
|
+
'country_code': code,
|
|
27
|
+
'carrier': info['prefixes'][prefix],
|
|
28
|
+
'prefix': prefix,
|
|
29
|
+
'is_mvno': info.get('mvno', {}).get(prefix, False),
|
|
30
|
+
'line_type': 'mobile'
|
|
31
|
+
}
|
|
32
|
+
return {'valid': False, 'error': 'Provider not found'}
|
|
33
|
+
|
|
34
|
+
return {'valid': False, 'error': 'Country not supported'}
|
|
35
|
+
|
|
36
|
+
def validate(self, phone: str) -> bool:
|
|
37
|
+
return self.lookup(phone).get('valid', False)
|
PhantomAPI/provider.py
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
PROVIDERS = {
|
|
2
|
+
# ==================== INDONESIA (62) ====================
|
|
3
|
+
'ID': {
|
|
4
|
+
'name': 'Indonesia',
|
|
5
|
+
'code': '62',
|
|
6
|
+
'prefixes': {
|
|
7
|
+
# Telkomsel
|
|
8
|
+
'0811': 'Telkomsel', '0812': 'Telkomsel', '0813': 'Telkomsel',
|
|
9
|
+
'0821': 'Telkomsel', '0822': 'Telkomsel', '0823': 'Telkomsel',
|
|
10
|
+
'0851': 'Telkomsel', '0852': 'Telkomsel', '0853': 'Telkomsel',
|
|
11
|
+
# Indosat
|
|
12
|
+
'0814': 'Indosat Ooredoo', '0815': 'Indosat Ooredoo', '0816': 'Indosat Ooredoo',
|
|
13
|
+
'0855': 'Indosat Ooredoo', '0856': 'Indosat Ooredoo', '0857': 'Indosat Ooredoo',
|
|
14
|
+
'0858': 'Indosat Ooredoo',
|
|
15
|
+
# XL Axiata
|
|
16
|
+
'0817': 'XL Axiata', '0818': 'XL Axiata', '0819': 'XL Axiata',
|
|
17
|
+
'0877': 'XL Axiata', '0878': 'XL Axiata', '0879': 'XL Axiata',
|
|
18
|
+
# Tri (3)
|
|
19
|
+
'0895': 'Tri', '0896': 'Tri', '0897': 'Tri', '0898': 'Tri', '0899': 'Tri',
|
|
20
|
+
# Smartfren
|
|
21
|
+
'0881': 'Smartfren', '0882': 'Smartfren', '0883': 'Smartfren',
|
|
22
|
+
'0884': 'Smartfren', '0885': 'Smartfren', '0886': 'Smartfren',
|
|
23
|
+
'0887': 'Smartfren', '0888': 'Smartfren', '0889': 'Smartfren',
|
|
24
|
+
},
|
|
25
|
+
'mvno': {
|
|
26
|
+
'0859': 'By.U', # MVNO Telkomsel
|
|
27
|
+
},
|
|
28
|
+
'regex': r'^62[0-9]{9,12}$'
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
# ==================== MALAYSIA (60) ====================
|
|
32
|
+
'MY': {
|
|
33
|
+
'name': 'Malaysia',
|
|
34
|
+
'code': '60',
|
|
35
|
+
'prefixes': {
|
|
36
|
+
'010': 'DiGi', '011': 'U Mobile', '012': 'Maxis', '013': 'Celcom',
|
|
37
|
+
'014': 'Maxis/Celcom', '015': 'Tune Talk', '016': 'DiGi',
|
|
38
|
+
'017': 'Maxis', '018': 'U Mobile', '019': 'Celcom',
|
|
39
|
+
},
|
|
40
|
+
'regex': r'^60[0-9]{8,10}$'
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
# ==================== SINGAPURA (65) ====================
|
|
44
|
+
'SG': {
|
|
45
|
+
'name': 'Singapore',
|
|
46
|
+
'code': '65',
|
|
47
|
+
'prefixes': {
|
|
48
|
+
'8111': 'Singtel', '8112': 'Singtel', '8113': 'Singtel',
|
|
49
|
+
'8120': 'Singtel', '8121': 'Singtel', '8122': 'Singtel',
|
|
50
|
+
'8000': 'StarHub', '8001': 'StarHub', '8002': 'StarHub',
|
|
51
|
+
'8100': 'M1', '8101': 'M1', '8102': 'M1',
|
|
52
|
+
'8800': 'SIMBA', '8801': 'SIMBA',
|
|
53
|
+
},
|
|
54
|
+
'mvno': {
|
|
55
|
+
'8600': 'Circles.Life', '8660': 'GOMO', '8661': 'GOMO',
|
|
56
|
+
},
|
|
57
|
+
'regex': r'^65[0-9]{8}$'
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
# ==================== THAILAND (66) - NEW! ====================
|
|
61
|
+
'TH': {
|
|
62
|
+
'name': 'Thailand',
|
|
63
|
+
'code': '66',
|
|
64
|
+
'prefixes': {
|
|
65
|
+
'080': 'AIS', '081': 'AIS', '082': 'AIS', '083': 'AIS',
|
|
66
|
+
'084': 'AIS', '085': 'AIS', '086': 'AIS',
|
|
67
|
+
'089': 'AIS',
|
|
68
|
+
'061': 'AIS', '062': 'AIS', '063': 'AIS', '064': 'AIS',
|
|
69
|
+
'065': 'AIS', '069': 'AIS',
|
|
70
|
+
'090': 'DTAC', '091': 'DTAC', '092': 'DTAC', '093': 'DTAC',
|
|
71
|
+
'094': 'DTAC', '095': 'DTAC', '096': 'DTAC', '097': 'DTAC',
|
|
72
|
+
'098': 'DTAC', '099': 'DTAC',
|
|
73
|
+
'0810': 'TrueMove', '0811': 'TrueMove', '0812': 'TrueMove',
|
|
74
|
+
'0610': 'TrueMove', '0611': 'TrueMove', '0612': 'TrueMove',
|
|
75
|
+
},
|
|
76
|
+
'regex': r'^66[0-9]{9,10}$'
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
# ==================== VIETNAM (84) - NEW! ====================
|
|
80
|
+
'VN': {
|
|
81
|
+
'name': 'Vietnam',
|
|
82
|
+
'code': '84',
|
|
83
|
+
'prefixes': {
|
|
84
|
+
'086': 'Viettel', '096': 'Viettel', '097': 'Viettel',
|
|
85
|
+
'098': 'Viettel', '032': 'Viettel', '033': 'Viettel',
|
|
86
|
+
'034': 'Viettel', '035': 'Viettel', '036': 'Viettel',
|
|
87
|
+
'037': 'Viettel', '038': 'Viettel', '039': 'Viettel',
|
|
88
|
+
'070': 'Mobifone', '076': 'Mobifone', '077': 'Mobifone',
|
|
89
|
+
'078': 'Mobifone', '079': 'Mobifone', '089': 'Mobifone',
|
|
90
|
+
'090': 'Vinaphone', '091': 'Vinaphone', '088': 'Vinaphone',
|
|
91
|
+
'083': 'Vinaphone', '084': 'Vinaphone', '085': 'Vinaphone',
|
|
92
|
+
'081': 'Vinaphone', '082': 'Vinaphone',
|
|
93
|
+
},
|
|
94
|
+
'regex': r'^84[0-9]{9,10}$'
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
# ==================== JEPANG (81) - NEW! ====================
|
|
98
|
+
'JP': {
|
|
99
|
+
'name': 'Japan',
|
|
100
|
+
'code': '81',
|
|
101
|
+
'prefixes': {
|
|
102
|
+
'070': 'NTT Docomo', '080': 'NTT Docomo', '090': 'NTT Docomo',
|
|
103
|
+
'050': 'NTT Docomo',
|
|
104
|
+
'060': 'au (KDDI)', '070': 'au (KDDI)', '080': 'au (KDDI)',
|
|
105
|
+
'090': 'au (KDDI)', '0700': 'au (KDDI)',
|
|
106
|
+
'0701': 'SoftBank', '0801': 'SoftBank', '0901': 'SoftBank',
|
|
107
|
+
'0702': 'SoftBank', '0802': 'SoftBank', '0902': 'SoftBank',
|
|
108
|
+
},
|
|
109
|
+
'regex': r'^81[0-9]{10}$'
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
# ==================== PHILIPPINES (63) ====================
|
|
113
|
+
'PH': {
|
|
114
|
+
'name': 'Philippines',
|
|
115
|
+
'code': '63',
|
|
116
|
+
'prefixes': {
|
|
117
|
+
'917': 'Globe', '918': 'Globe', '919': 'Globe', '920': 'Globe',
|
|
118
|
+
'921': 'Globe', '922': 'Globe', '923': 'Globe', '924': 'Globe',
|
|
119
|
+
'925': 'Globe', '926': 'Globe', '927': 'Globe', '928': 'Globe',
|
|
120
|
+
'929': 'Globe', '905': 'Globe', '906': 'Globe', '907': 'Globe',
|
|
121
|
+
'915': 'Globe', '916': 'Globe', '956': 'Globe', '957': 'Globe',
|
|
122
|
+
'908': 'Smart', '909': 'Smart', '910': 'Smart', '911': 'Smart',
|
|
123
|
+
'912': 'Smart', '913': 'Smart', '914': 'Smart',
|
|
124
|
+
'938': 'Smart', '939': 'Smart', '940': 'Smart', '941': 'Smart',
|
|
125
|
+
'942': 'Smart', '943': 'Smart', '944': 'Smart', '945': 'Smart',
|
|
126
|
+
'991': 'DITO', '992': 'DITO', '993': 'DITO', '994': 'DITO',
|
|
127
|
+
'995': 'DITO', '996': 'DITO', '997': 'DITO', '998': 'DITO', '999': 'DITO',
|
|
128
|
+
},
|
|
129
|
+
'regex': r'^63[0-9]{10}$'
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
# ==================== INDIA (91) ====================
|
|
133
|
+
'IN': {
|
|
134
|
+
'name': 'India',
|
|
135
|
+
'code': '91',
|
|
136
|
+
'prefixes': {
|
|
137
|
+
'9810': 'Airtel', '9811': 'Airtel', '9812': 'Airtel',
|
|
138
|
+
'9820': 'Vodafone Idea', '9821': 'Vodafone Idea', '9822': 'Vodafone Idea',
|
|
139
|
+
'9870': 'Jio', '9871': 'Jio', '9872': 'Jio', '9873': 'Jio',
|
|
140
|
+
'8888': 'BSNL', '8889': 'BSNL',
|
|
141
|
+
},
|
|
142
|
+
'regex': r'^91[0-9]{10}$'
|
|
143
|
+
},
|
|
144
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: phantomapi
|
|
3
|
+
Version: 1.0.1
|
|
4
|
+
Summary: Phone number OSINT library for Indonesia
|
|
5
|
+
Author: TheZ4th
|
|
6
|
+
Author-email: zethkaretjir@gmail.com
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Requires-Python: >=3.6
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
Dynamic: author
|
|
12
|
+
Dynamic: author-email
|
|
13
|
+
Dynamic: classifier
|
|
14
|
+
Dynamic: description-content-type
|
|
15
|
+
Dynamic: requires-python
|
|
16
|
+
Dynamic: summary
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
PhantomAPI/__init__.py,sha256=tbDxiyLj_8vwIOGR6xtfbYi0my6aTOPC_lmLGuSddKQ,145
|
|
2
|
+
PhantomAPI/core.py,sha256=e4gttyvLBfnlTYaN3b8tTS8S8PnqGhnwKqsWtOK7NRw,1473
|
|
3
|
+
PhantomAPI/provider.py,sha256=sLzlTLOg7UCqx5sIyuQ5VJbxlAvoK9drS8ILfU4ouwQ,6009
|
|
4
|
+
phantomapi-1.0.1.dist-info/METADATA,sha256=ixlwTlqqOfeTkC5zdsed9kkIHHaujtDha6oBPKB6Aig,453
|
|
5
|
+
phantomapi-1.0.1.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
6
|
+
phantomapi-1.0.1.dist-info/top_level.txt,sha256=vMh73lqsa17xC4ItNIMuoLoLfwn7azxlQXHStKr4BC8,11
|
|
7
|
+
phantomapi-1.0.1.dist-info/RECORD,,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
PhantomAPI
|