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
Metadata
Release files for brzipcode 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| brzipcode-0.1.2.tar.gz | 2.9 kB | Without provenance | Details for brzipcode-0.1.2.tar.gz |
Release files / brzipcode-0.1.2.tar.gz
| Download URL | brzipcode-0.1.2.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4ec9e930edc4d484a5202ade52f98be3f3b66d85539878389810cc2cdffc9414
|
|
BLAKE2b-256 checksum How to use checksums |
b8071fec205826e29c2f827db67ecc8858044649737637558ca8b5f4f2f83cfb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for brzipcode 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.