Skip to content

Instantly share code, notes, and snippets.

@petrusnog
Last active February 23, 2022 14:42
Show Gist options
  • Save petrusnog/1f9ab4b5012bb163556831dcdf92b385 to your computer and use it in GitHub Desktop.
Save petrusnog/1f9ab4b5012bb163556831dcdf92b385 to your computer and use it in GitHub Desktop.
Gerador de paulistas mediante cobertura de cidades
# pip install fordev
from fordev.generators import people
searching_valid_cep = True
covered_cities = ['São Paulo', 'Guarulhos', 'Campinas']
print('Aguarde, estou gerando dados de um cliente fantasma na cidade de São Paulo...')
while(searching_valid_cep) :
new_people = people(uf_code='SP')[0]
print(new_people['cep'], ' - ', new_people['cidade'])
if (new_people['cidade'] in covered_cities) :
searching_valid_cep = False
print('\n\n')
print('Nome: ' + new_people.get('nome'))
print('CPF: ' + new_people.get('cpf'))
print('Endereço: ' + new_people.get('endereco') + ', ' + str(new_people.get('numero')))
print('Bairro: ' + new_people.get('bairro'))
print('CEP: ' + new_people.get('cep'))

Paulista Generator

Gerador de paulistas mediante cobertura de cidades

How to use

python3 --version
pip --version
pip install fordev
python3 paulista-generator.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment