Coverage for /var/srv/projects/api.amasfac.comuna18.com/tmp/venv/lib/python3.9/site-packages/faker/providers/phone_number/__init__.py: 79%

12 statements  

« prev     ^ index     » next       coverage.py v6.4.4, created at 2023-07-17 14:22 -0600

1from .. import BaseProvider, ElementsType 

2 

3# Data source 

4# 

5# The country codes in this provider comes from the following source: 

6# List of country calling codes 

7# https://en.wikipedia.org/wiki/List_of_country_calling_codes 

8# 

9# Data was collected from the alphabetical listing by country or region 

10 

11localized = True 

12 

13 

14class Provider(BaseProvider): 

15 

16 country_calling_codes: ElementsType[str] = ( 

17 "+93", 

18 "+358 18", 

19 "+355", 

20 "+213", 

21 "+1 684", 

22 "+376", 

23 "+244", 

24 "+1 264", 

25 "+1 268", 

26 "+54", 

27 "+374", 

28 "+297", 

29 "+247", 

30 "+61", 

31 "+672 1", 

32 "+672", 

33 "+43", 

34 "+994", 

35 "+1 242", 

36 "+973", 

37 "+880", 

38 "+1 246", 

39 "+1 268", 

40 "+375", 

41 "+32", 

42 "+501", 

43 "+229", 

44 "+1 441", 

45 "+975", 

46 "+591", 

47 "+599 7", 

48 "+387", 

49 "+267", 

50 "+55", 

51 "+246", 

52 "+1 284", 

53 "+673", 

54 "+359", 

55 "+226", 

56 "+257", 

57 "+855", 

58 "+237", 

59 "+1", 

60 "+238", 

61 "+599 3", 

62 "+599 4", 

63 "+599 7", 

64 "+1 345", 

65 "+236", 

66 "+235", 

67 "+64", 

68 "+56", 

69 "+86", 

70 "+61 89164", 

71 "+61 89162", 

72 "+57", 

73 "+269", 

74 "+242", 

75 "+243", 

76 "+682", 

77 "+506", 

78 "+385", 

79 "+53", 

80 "+599 9", 

81 "+357", 

82 "+420", 

83 "+45", 

84 "+246", 

85 "+253", 

86 "+1 767", 

87 "+1 809", 

88 "+1 829", 

89 "+1 849", 

90 "+670", 

91 "+56", 

92 "+593", 

93 "+20", 

94 "+503", 

95 "+881 2", 

96 "+881 3", 

97 "+882 13", 

98 "+240", 

99 "+291", 

100 "+372", 

101 "+268", 

102 "+251", 

103 "+500", 

104 "+298", 

105 "+679", 

106 "+358", 

107 "+33", 

108 "+596", 

109 "+594", 

110 "+689", 

111 "+241", 

112 "+220", 

113 "+995", 

114 "+49", 

115 "+233", 

116 "+350", 

117 "+881", 

118 "+881 8", 

119 "+881 9", 

120 "+30", 

121 "+299", 

122 "+1 473", 

123 "+590", 

124 "+1 671", 

125 "+502", 

126 "+44 1481", 

127 "+44 7781", 

128 "+44 7839", 

129 "+44 7911", 

130 "+224", 

131 "+245", 

132 "+592", 

133 "+509", 

134 "+504", 

135 "+852", 

136 "+36", 

137 "+354", 

138 "+881 0", 

139 "+881 1", 

140 "+91", 

141 "+62", 

142 "+870", 

143 "+800", 

144 "+882", 

145 "+883", 

146 "+979", 

147 "+808", 

148 "+98", 

149 "+964", 

150 "+353", 

151 "+881 6", 

152 "+881 7", 

153 "+44 1624", 

154 "+44 7524", 

155 "+44 7624", 

156 "+44 7924", 

157 "+972", 

158 "+39", 

159 "+225", 

160 "+1 876", 

161 "+47 79", 

162 "+81", 

163 "+44 1534", 

164 "+962", 

165 "+7 6", 

166 "+7 7", 

167 "+254", 

168 "+686", 

169 "+850", 

170 "+82", 

171 "+383", 

172 "+965", 

173 "+996", 

174 "+856", 

175 "+371", 

176 "+961", 

177 "+266", 

178 "+231", 

179 "+218", 

180 "+423", 

181 "+370", 

182 "+352", 

183 "+853", 

184 "+261", 

185 "+265", 

186 "+60", 

187 "+960", 

188 "+223", 

189 "+356", 

190 "+692", 

191 "+596", 

192 "+222", 

193 "+230", 

194 "+262 269", 

195 "+262 639", 

196 "+52", 

197 "+691", 

198 "+1 808", 

199 "+373", 

200 "+377", 

201 "+976", 

202 "+382", 

203 "+1 664", 

204 "+212", 

205 "+258", 

206 "+95", 

207 "+374 47", 

208 "+374 97", 

209 "+264", 

210 "+674", 

211 "+977", 

212 "+31", 

213 "+1 869", 

214 "+687", 

215 "+64", 

216 "+505", 

217 "+227", 

218 "+234", 

219 "+683", 

220 "+672 3", 

221 "+389", 

222 "+90 392", 

223 "+44 28", 

224 "+1 670", 

225 "+47", 

226 "+968", 

227 "+92", 

228 "+680", 

229 "+970", 

230 "+507", 

231 "+675", 

232 "+595", 

233 "+51", 

234 "+63", 

235 "+64", 

236 "+48", 

237 "+351", 

238 "+1 787", 

239 "+1 939", 

240 "+974", 

241 "+262", 

242 "+40", 

243 "+7", 

244 "+250", 

245 "+599 4", 

246 "+590", 

247 "+290", 

248 "+1 869", 

249 "+1 758", 

250 "+590", 

251 "+508", 

252 "+1 784", 

253 "+685", 

254 "+378", 

255 "+239", 

256 "+966", 

257 "+221", 

258 "+381", 

259 "+248", 

260 "+232", 

261 "+65", 

262 "+599 3", 

263 "+1 721", 

264 "+421", 

265 "+386", 

266 "+677", 

267 "+252", 

268 "+27", 

269 "+500", 

270 "+995 34", 

271 "+211", 

272 "+34", 

273 "+94", 

274 "+249", 

275 "+597", 

276 "+47 79", 

277 "+46", 

278 "+41", 

279 "+963", 

280 "+886", 

281 "+992", 

282 "+255", 

283 "+888", 

284 "+66", 

285 "+882 16", 

286 "+228", 

287 "+690", 

288 "+676", 

289 "+373 2", 

290 "+373 5", 

291 "+1 868", 

292 "+290 8", 

293 "+216", 

294 "+90", 

295 "+993", 

296 "+1 649", 

297 "+688", 

298 "+256", 

299 "+380", 

300 "+971", 

301 "+44", 

302 "+1", 

303 "+878", 

304 "+598", 

305 "+1 340", 

306 "+998", 

307 "+678", 

308 "+39 06 698", 

309 "+379", 

310 "+58", 

311 "+84", 

312 "+1 808", 

313 "+681", 

314 "+967", 

315 "+260", 

316 "+255 24", 

317 "+263", 

318 ) 

319 

320 formats: ElementsType[str] = ("###-###-###",) 

321 

322 msisdn_formats: ElementsType[str] = ("#############",) 

323 

324 def phone_number(self) -> str: 

325 return self.numerify(self.random_element(self.formats)) 

326 

327 def country_calling_code(self) -> str: 

328 return self.random_element(self.country_calling_codes) 

329 

330 def msisdn(self) -> str: 

331 """https://en.wikipedia.org/wiki/MSISDN""" 

332 return self.numerify(self.random_element(self.msisdn_formats))