-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
264c1a9
commit 04cee56
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,41 @@ | ||
# numberlocator | ||
|
||
Usando Python para descobrir operadora e região de um número de telefone. | ||
|
||
<strong> Biblioteca: </strong> | ||
``` | ||
pip install phonenumbers | ||
``` | ||
|
||
<strong> 📦 Download: </strong> https://pypi.org/project/phonenumbers/ | ||
|
||
```python | ||
import phonenumbers | ||
``` | ||
|
||
<strong> # import geocoder, carrier </strong> | ||
```python | ||
from phonenumbers import geocoder, carrier | ||
``` | ||
|
||
<strong> Especifique o número de telefone </strong> | ||
|
||
```python | ||
a =input("Digite o número de telefone:") | ||
``` | ||
<strong> Região </strong> | ||
```python | ||
phonenumber = phonenumbers.parse(a) | ||
``` | ||
|
||
<strong> Capturando a operadora </strong> | ||
```python | ||
operadora = carrier.name_for_number(phonenumber, 'pt-br') | ||
``` | ||
<strong> Exibir a localização do número de telefone </strong> | ||
```python | ||
regiao = geocoder.description_for_number(phonenumber, 'pt-br') | ||
|
||
print("O estado é: " +regiao) | ||
print("a Operadora é:" + operadora) | ||
``` |