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.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: brazilcep-6.6.0.tar.gz
  • Upload date:
  • Size: 11.7 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.0.tar.gz
Algorithm Hash digest
SHA256 9c4f035f4b7705287de75366b021885681980325aed757dbdbe94183efda0823
MD5 1ba86755259c50c54eeffa0d07016072
BLAKE2b-256 deaeb4c4431f6c3c5e35164597af5ba17dd5584286e1325aab8c977e75adaa05

See more details on using hashes here.

Provenance

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

Publisher: release.yml on mstuttgart/brazilcep

Attestations:

File details

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

File metadata

  • Download URL: brazilcep-6.6.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 755420791da5a62477c35793bd322d27a3556e00b6f0f062648e7b8758c59677
MD5 9bbd7a628c74922926f86b9c0e312308
BLAKE2b-256 98d8fb3b46ca613d2d16857d7bef1470fcdc34aea722ed9c24d47e5fc189a1ee

See more details on using hashes here.

Provenance

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