Skip to main content

Consulta CEP pelo webservice do ViaCEP.com.br

Project description

# ViaCEP em Python

[![PyPI version](https://badge.fury.io/py/viacep-python.svg?1.0](https://pypi.python.org/pypi/viacep)
[![Build Status](https://travis-ci.org/leogregianin/viacep-python.svg)](https://travis-ci.org/leogregianin/viacep-python)
[![codecov](https://codecov.io/gh/leogregianin/viacep-python/branch/master/graph/badge.svg)](https://codecov.io/gh/leogregianin/viacep-python)

Buscar informações do CEP com o webservice do site http://www.viacep.com.br

## Pré requisitos

* Instalação de qualquer versão do Python (http://www.python.org/download)

## Instalação das dependências

```bash
$ pip install -r requirements.txt
```

## Utilização

```bash
>>> import viacep
>>> d = viacep.ViaCEP('78048000')
>>> data = d.getDadosCEP()
>>> data
{'cep': '78048-000', 'logradouro': 'Avenida Miguel Sutil', 'complemento': 'de 5686 a 6588 - lado par', 'bairro': 'Alvorada', 'localidade': 'Cuiabá', 'uf': 'MT', 'unidade': '', 'ibge': '5103403', 'gia': ''}
>>> data['localidade']
'Cuiabá'
>>> data['uf']
'MT'
>>>
```

Licença
-------
[Licença MIT](LICENSE)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

viacep-1.2.0.tar.gz (2.0 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page