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 | How to Use | 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.6.1.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

brazilcep-6.6.1-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for brazilcep-6.6.1.tar.gz
Algorithm Hash digest
SHA256 8cb5ff687b77985fd681df0c3c9fc565e04bf4735b99cb7c7b461b4118f5cbe4
MD5 202cc7ca2ee5fb801975c621316dc2db
BLAKE2b-256 c76e56cce13ca0c145599ff8a027948cc146554807b3e13641134755bfc6c43f

See more details on using hashes here.

Provenance

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

Publisher: release.yml on mstuttgart/brazilcep

Attestations:

File details

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

File metadata

  • Download URL: brazilcep-6.6.1-py3-none-any.whl
  • Upload date:
  • Size: 9.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.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 084ff066c4908f2b0805d9bb3454012e961546b386f8277a43f042f3d1d8943b
MD5 f153f54ece09bf4929e67deda3e2db52
BLAKE2b-256 202a76446bb76b12ad9652535149b50077fa2a7db8496d586223f8477574e8e5

See more details on using hashes here.

Provenance

The following attestation bundles were made for brazilcep-6.6.1-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