Minimalist and easy-to-use python library designed to query CEP (brazilian zip codes) data
Project description
BrazilCEP
Minimalist and easy-to-use python library designed to query CEP (brazilian zip codes) data.
About | Install | How to Use | Documentation Contribute Credits
BrazilCEP is a minimalist and easy-to-use python library designed to query CEP (brazilian zip codes) data.
Its objective is to provide a common query interface to all these search services, facilitating the integration of Python applications with these services.
- Cross-platform: Windows, Mac, and Linux are officially supported.
- Works with Python 3.8, 3.9, 3.10 and 3.11.
- Currently supports several CEP API's:
BrazilCEP** is the new mane of former PyCEPCorreio python library. If you want to migrate the old code to the new version, please see the migrate section in docs.
Install
The recommended way to get BrazilCEP is to install the latest stable release via pip:
pip install brazilcep
We currently support Python 3.8+ only. Users on older interpreter versions are urged to upgrade.
How to Use
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.
Documentation
Documentation for the current version of BrazilCEP is available from the official docs here.
Contribute
See this guideline here.
Credits
Copyright (C) 2016-2023 by Michell Stuttgart
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for brazilcep-6.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 560f9a800eba1b1b2d0533c8b2fed09b48cbc5458fffb843b0facfa95f905f8c |
|
MD5 | 03191e22ea0c2c5bbaa0145a4ea64fbe |
|
BLAKE2b-256 | 302761cfa419cf9261c32156329c6cc1f53d8d9a732c3254377a8f799d4c7282 |