Skip to content

Python script for routine optimization of the BackOffice sector.

License

Notifications You must be signed in to change notification settings

emy-devfullstack/Automation-cep

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

en pt-br

📊 Address Data Lookup by ZIP Code (CEP)

This Python script queries the public ViaCEP API to retrieve address information (name and type) from a list of ZIP codes (CEPs). It handles errors, extracts the type of address, and displays the results in the console, as well as saving the data to a CSV file (ceps_logradouros.csv). The script makes a request every 0.5 seconds to avoid overloading the server.

Features:

  • Retrieve address and type from a ZIP code (CEP).
  • Error handling and default response for invalid ZIP codes.
  • Display results in the console and save them to a CSV file.

How to Use:

  1. Copy the code.
  2. Install the requests library: pip install requests.
  3. Run the script: python search_zip.py.

Example of CSV Output:

cep,logradouro,tipo_logradouro
32370-670,Rua ABC,Rua
65058-324,Avenida dos Trabalhadores,Avenida

About

Python script for routine optimization of the BackOffice sector.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages