Migrate
BrazilCEP is tne new name of former PycepCorreios. This page guide you on to process of migrate old code to new version.
It's simples migrate te code and require minimal steps.
imports
First, rename the import
statements from:
Query results
The next step, is adjust the keys of query returned by get_address_from_cep
function.
The keys have simply been translated to english. Take a look on this old code:
PyCEPCorreios
This is the new code:
>>> get_address_from_cep('37503-130')
{
'bairro': 'rua abc',
'cep': '37503130',
'cidade': 'city ABC',
'logradouro': 'str',
'uf': 'str',
'complemento': 'str',
}
BrazilCEP
>>> get_address_from_cep('37503-130')
{
'district': 'rua abc',
'cep': '37503130',
'city': 'city ABC',
'street': 'str',
'uf': 'str',
'complement': 'str',
}
Exceptions
The follow Exceptions have been removed.
Please, use the requests exceptions instead.
Questions?
The best way to send question is open a issue in BrazilCEP issue tracker here.