Giter Site home page Giter Site logo

brzipcode's Introduction

brzipcode

brzipcode é uma lib Python simples para retornar o endereço a partir do CEP, com dados provenientes do webservice brzipcode.com.

Para instalar execute:

pip install brzipcode

E então usar conforme abaixo:

>>> from brzipcode import BRZipCode
>>> print BRZipCode.get('04538132', token='ycmVyGJO3HAw...') # *
{u'status': True, u'city': u'S\xe3o Paulo', u'state': u'SP', u'neighborhood': u'Itaim Bibi', u'address': u'Avenida Brigadeiro Faria Lima - de 3252 ao fim - lado par'}

** Para solicitar um token acesse http://brzipcode.com/ (gratuito) **

Caso não encontre nenhum resultado:

>>> print BRZipCode.get('00000000', token='ycmVyGJO3HAw...')
{u'status': False, u'error_message': u'not_found'}

Suporte a projetos Django

Para utilizar em seu projeto Django, inclua BRZIPCODE_TOKEN e atualize o INSTALLED_APPS no arquivo settings.py

BRZIPCODE_TOKEN = 'ycmVyGJO3HAw...'

...

INSTALLED_APPS = (
    ...
    'brzipcode',
)

Adicionar a url do serviço no urls.py

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

E acesse:

http://localhost:8000/brzipcode/?zip_code=04538132

brzipcode's People

Contributors

renatogp avatar viniciuscainelli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.