Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

easy_zipcode is a lightweight python app for retrieving brazilian address from a zip code

Project description

easyzipcode é uma lib Python usada para retornar informações de um determinado endereço a partir do CEP, com dados provenientes do webservice easyzipcode.io

Para instalar o easyzipcode, faça o download zip através do github:

https://github.com/stored/easy_zipcode

Feito o download, descompacte-o no diretório de seu projeto e digite o seguinte comando:

python setup.py install

Você também pode instalar através do pacote pip:

pip install easy_zipcode

Usando no terminal:

>>> from easy_zipcode import EasyZipCode
>>> print EasyZipCode.get_zipcode('14415000', token='3850de3a-2422-482...')
{"city": "Patroc\u00ednio Paulista", "ibge": "3536307", "area": "", "complement": "", "address": "", "zip_code": "14415000"}

No arquivo settings.py de seu projeto, adicione a app easyzipcode e o token gerado:

EASY_ZIPCODE_TOKEN = '3850de3a-2422-482d-92fc-d1a48a71eba1'

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',

    ...
    'easy_zipcode',
    ...
)

Adicione a seguinte linha no arquivo urls.py do seu projeto:

urlpatterns = patterns('',
    ...
    url(r'^easyzipcode/', include(easy_zipcode.urls())),
)

Project details


Download files

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

Files for easy_zipcode, version 0.1.7
Filename, size File type Python version Upload date Hashes
Filename, size easy_zipcode-0.1.7.tar.gz (2.8 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page