Skip to main content

brzipcode is a lightweight app for retrieving brazilian addresses from a zip code

Project description

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

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

brzipcode-0.1.2.tar.gz (2.9 kB view details)

Uploaded Source

File details

Details for the file brzipcode-0.1.2.tar.gz.

File metadata

  • Download URL: brzipcode-0.1.2.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for brzipcode-0.1.2.tar.gz
Algorithm Hash digest
SHA256 4ec9e930edc4d484a5202ade52f98be3f3b66d85539878389810cc2cdffc9414
MD5 b28084d9b1992c7d61d0f5526e695e48
BLAKE2b-256 b8071fec205826e29c2f827db67ecc8858044649737637558ca8b5f4f2f83cfb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page