Skip to main content

Pesquisa de CEPs via site dos Correios

Project description

Esta biblioteca acessa o site dos Correios para fazer pesquisa por CEP.

USO

>>> from cep import Correios
>>> c = Correios()
>>> resultados = c.consulta('Juarez')
>>> len(resultados)
100
>>> resultados[64]
{'Localidade': u'Jo\xe3o Pessoa', 'Bairro': u'Torre', 'UF': u'PB', 'Logradouro': u'Avenida Juarez T\xe1vora - de 1147/1148 a 1911/', 'CEP': u'58040-021'}
>>> c.detalhe(64)
{'Localidade': u'Jo\xe3o Pessoa', 'Bairro': u'Torre', 'UF': u'PB', 'Logradouro': u'Avenida Juarez T\xe1vora - de 1147/1148 a 1911/1912', 'CEP': u'58040-021'}
>>> c.consulta('91370000', primeiro=True)
{'Localidade': u'Porto Alegre', 'Bairro': u'Vila Ipiranga', 'UF': u'RS', 'Logradouro': u'Rua Alberto Silva - at\xe9 965/966', 'CEP': u'91370-000'}

REQUIREMENTS

  • BeautifulSoup

LICENSE

  • MIT License

TODO

  • Documentação
  • Criar setup.py e registrar no PyPi
  • Hospedar API pública (json/xml)

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 cep, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size cep-0.1.1.tar.gz (2.9 kB) File type Source Python version None Upload date Hashes View

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 Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page