Skip to main content

Minimalist and easy-to-use python library designed to query CEP (brazilian zip codes) data

Project description


BrazilCEP

GitHub Workflow Status Codecov readthedocs Downloads Ratings Version

About | Install | Quick Start | Documentation | Contribute | Credits

About

BrazilCEP is a minimalist and easy-to-use Python library designed to query CEP (Postal Address Code) data.

Its objective is to provide a common query interface to all these search services, facilitating the integration of Python applications with these services.

Currently supports several CEP API's:

[!NOTE] BrazilCEP is the new name of former PyCEPCorreio Python library. If you want to migrate the old code to the new version, please see the migrate section in docs.

[!TIP] CEP or Código de Endereçamento Postal (Postal Address Code), as it is also known, is a system of numeric codes, created, maintained and organized by Correios do Brazil for organizing addresses and deliveries of letters and parcels.

Install

The recommended way to get BrazilCEP is to install the latest stable release via pip:

pip install brazilcep

Quick Start

Making a request is very simple. Begin by importing the BrazilCEP module:

>>> import brazilcep

Now, call the get_address_from_cep to query any CEP:

>>> address = brazilcep.get_address_from_cep('37503-130')

Now, we have a dict object called address. We can get all the address information we need from this object:

 >>> address
{
    'district': 'rua abc',
    'cep': '37503130',
    'city': 'city ABC',
    'street': 'str',
    'uf': 'str',
    'complement': 'str',
}

The CEP always must be a string.

[!TIP] BrazilCEP was developed to integrate on-demand queries into web pages. Querying CEP in bulk through scripts or any other means is not recommended.

[!IMPORTANT] BrazilCEP is not responsible for the functioning, availability and support of any of these query API's. All of them are provided by third parties, and this library just provides a handy way to centralize the CEP search on these services.

Documentation

Documentation for the current version of BrazilCEP is available here.

Contribute

See this guideline here.

Credits

Copyright (C) 2016-2024 by Michell Stuttgart

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

brazilcep-6.7.0.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

brazilcep-6.7.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file brazilcep-6.7.0.tar.gz.

File metadata

  • Download URL: brazilcep-6.7.0.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for brazilcep-6.7.0.tar.gz
Algorithm Hash digest
SHA256 d86f9264ec80c5069281d4ee3bb1297c389143da34bee18ef970a5fa35a6c059
MD5 82921ead0594f0912d91d875cd213561
BLAKE2b-256 82dcad15b6b90f35636142099a5d911899fba58d0c6d0b787fa7a1138f95f8dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for brazilcep-6.7.0.tar.gz:

Publisher: release.yml on mstuttgart/brazilcep

Attestations:

File details

Details for the file brazilcep-6.7.0-py3-none-any.whl.

File metadata

  • Download URL: brazilcep-6.7.0-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for brazilcep-6.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 702bd18e3e9ae30118d6fc60681af68a3b7c2b1035db76c0c2de856135c820da
MD5 7a9b4a5736df7236c41afa3f0e07d858
BLAKE2b-256 55296e897aaa0235fb86f05c5fac4bcaab50adb934960050cf378568e52f7afc

See more details on using hashes here.

Provenance

The following attestation bundles were made for brazilcep-6.7.0-py3-none-any.whl:

Publisher: release.yml on mstuttgart/brazilcep

Attestations:

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