Name | brazilcep JSON |
Version |
7.0.1
JSON |
| download |
home_page | None |
Summary | Minimalist and easy-to-use Python library designed to query CEP (Postal Address Code) data |
upload_time | 2025-08-16 12:21:27 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | MIT License
Copyright (c) 2016-2024, Michell Stuttgart
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
keywords |
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<h2 align="center">
<a href="https://pypi.org/project/brazilcep/">
<img src="https://github.com/mstuttgart/brazilcep/assets/8174740/fb7c86c8-6261-4300-b2e0-65877084d865" width="15%" alt="BrazilCEP Logo">
</a>
<br>
BrazilCEP
</h2>
<p align="center">
<a href="https://github.com/mstuttgart/brazilcep/actions?query=workflow%3A%22Github+CI%22">
<img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/mstuttgart/brazilcep/test.yml?color=fcd800&branch=main">
</a>
<a href="https://codecov.io/gh/mstuttgart/brazilcep">
<img alt="Codecov" src="https://img.shields.io/codecov/c/github/mstuttgart/brazilcep?color=fcd800">
</a>
<a href="https://brazilcep.readthedocs.io/">
<img alt="Read the Docs" src="https://img.shields.io/readthedocs/brazilcep?color=fcd800">
</a>
<a href="https://pypi.org/project/brazilcep">
<img alt="Downloads" src="https://img.shields.io/pypi/dm/brazilcep?color=fcd800">
</a>
<a href="https://pypi.org/project/brazilcep">
<img alt="PyPI Version" src="https://img.shields.io/pypi/v/brazilcep.svg?color=fcd800">
</a>
<a href="https://pypi.org/project/brazilcep/">
<img alt="Python Versions" src="https://img.shields.io/pypi/pyversions/brazilcep.svg?color=fcd800">
</a>
</p>
<p align="center">
<a href="#about">About</a> |
<a href="#install">Install</a> |
<a href="#quick-start">Quick Start</a> |
<a href="#documentation">Documentation</a> |
<a href="#contribute">Contribute</a> |
<a href="#credits">Credits</a>
</p>
## About
**BrazilCEP** is a minimalist and easy-to-use Python library designed to query CEP (Postal Address Code) data.
Its goal is to provide a unified query interface for multiple search services, simplifying the integration of Python applications with these services.
Currently, it supports several CEP APIs:
- [ViaCEP](https://viacep.com.br)
- [ApiCEP (WideNet)](https://apicep.com)
- [OpenCEP](https://opencep.com)
> [!NOTE]
> **BrazilCEP** is the new name of the former **PyCEPCorreio** Python library.
> To migrate your old code to the new version, refer to the [migration guide](https://brazilcep.readthedocs.io/api.html#migrate-from-pycepcorreios).
> [!TIP]
> **CEP** or **Código de Endereçamento Postal** (_Postal Address Code_) is a system of numeric codes created, maintained, and organized by _Correios do Brasil_ to streamline address organization and delivery of letters and parcels.
## Install
To install the latest stable release of BrazilCEP, use [pip](http://pip-installer.org):
```sh
pip install brazilcep
```
## Quick Start
Making a request is straightforward. Start by importing the BrazilCEP module:
```python
>>> import brazilcep
```
Next, use the `get_address_from_cep` function to query any CEP:
```python
>>> address = brazilcep.get_address_from_cep('37503-130')
```
The result is a dictionary containing the address details:
```python
>>> address
{
'district': 'rua abc',
'cep': '37503130',
'city': 'city ABC',
'street': 'str',
'uf': 'str',
'complement': 'str',
}
```
The CEP must always be provided as a string.
> [!TIP]
> BrazilCEP is designed for on-demand queries in web applications. Bulk querying through scripts or other means is discouraged.
> [!IMPORTANT]
> BrazilCEP does not guarantee the availability or support of any third-party query APIs. This library serves as a convenient interface for accessing these services.
#### Asynchronous Requests with BrazilCEP
BrazilCEP (version >= 7.0.0) also supports asynchronous operations , allowing you to retrieve address information for a given CEP without blocking your application. This is particularly useful for web applications or services that require high responsiveness.
To perform an asynchronous request, use the `async_get_address_from_cep` function:
```python
import asyncio
import brazilcep
async def main():
address = await brazilcep.async_get_address_from_cep('37503-130')
print(address)
asyncio.run(main())
```
> [!NOTE]
> This function is asynchronous and must be awaited when called.
> Ensure that your environment supports asynchronous programming before using this function.
## Documentation
Comprehensive documentation for BrazilCEP is available on [ReadTheDocs](https://brazilcep.readthedocs.io/).
## Contribute
To contribute, follow the guidelines outlined [here](https://brazilcep.readthedocs.io/contributing.html).
## Credits
Copyright (C) 2016-2024 by Michell Stuttgart
Raw data
{
"_id": null,
"home_page": null,
"name": "brazilcep",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "Michell Stuttgart <michellstut@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/41/7f/59c96238ef36418166975c51a471577cfb6a644d0eebe1b74998e80b1a4d/brazilcep-7.0.1.tar.gz",
"platform": null,
"description": "<h2 align=\"center\">\n <a href=\"https://pypi.org/project/brazilcep/\">\n <img src=\"https://github.com/mstuttgart/brazilcep/assets/8174740/fb7c86c8-6261-4300-b2e0-65877084d865\" width=\"15%\" alt=\"BrazilCEP Logo\">\n </a>\n <br>\n BrazilCEP\n</h2>\n\n<p align=\"center\">\n\n <a href=\"https://github.com/mstuttgart/brazilcep/actions?query=workflow%3A%22Github+CI%22\">\n <img alt=\"GitHub Workflow Status\" src=\"https://img.shields.io/github/actions/workflow/status/mstuttgart/brazilcep/test.yml?color=fcd800&branch=main\">\n </a>\n\n <a href=\"https://codecov.io/gh/mstuttgart/brazilcep\">\n <img alt=\"Codecov\" src=\"https://img.shields.io/codecov/c/github/mstuttgart/brazilcep?color=fcd800\">\n </a>\n\n <a href=\"https://brazilcep.readthedocs.io/\">\n <img alt=\"Read the Docs\" src=\"https://img.shields.io/readthedocs/brazilcep?color=fcd800\">\n </a>\n\n <a href=\"https://pypi.org/project/brazilcep\">\n <img alt=\"Downloads\" src=\"https://img.shields.io/pypi/dm/brazilcep?color=fcd800\">\n </a>\n\n <a href=\"https://pypi.org/project/brazilcep\">\n <img alt=\"PyPI Version\" src=\"https://img.shields.io/pypi/v/brazilcep.svg?color=fcd800\">\n </a>\n\n <a href=\"https://pypi.org/project/brazilcep/\">\n <img alt=\"Python Versions\" src=\"https://img.shields.io/pypi/pyversions/brazilcep.svg?color=fcd800\">\n </a>\n\n</p>\n\n<p align=\"center\">\n <a href=\"#about\">About</a> |\n <a href=\"#install\">Install</a> |\n <a href=\"#quick-start\">Quick Start</a> |\n <a href=\"#documentation\">Documentation</a> |\n <a href=\"#contribute\">Contribute</a> |\n <a href=\"#credits\">Credits</a>\n</p>\n\n## About\n\n**BrazilCEP** is a minimalist and easy-to-use Python library designed to query CEP (Postal Address Code) data.\n\nIts goal is to provide a unified query interface for multiple search services, simplifying the integration of Python applications with these services.\n\nCurrently, it supports several CEP APIs:\n\n- [ViaCEP](https://viacep.com.br)\n- [ApiCEP (WideNet)](https://apicep.com)\n- [OpenCEP](https://opencep.com)\n\n> [!NOTE]\n> **BrazilCEP** is the new name of the former **PyCEPCorreio** Python library.\n> To migrate your old code to the new version, refer to the [migration guide](https://brazilcep.readthedocs.io/api.html#migrate-from-pycepcorreios).\n\n> [!TIP]\n> **CEP** or **C\u00f3digo de Endere\u00e7amento Postal** (_Postal Address Code_) is a system of numeric codes created, maintained, and organized by _Correios do Brasil_ to streamline address organization and delivery of letters and parcels.\n\n## Install\n\nTo install the latest stable release of BrazilCEP, use [pip](http://pip-installer.org):\n\n```sh\npip install brazilcep\n```\n\n## Quick Start\n\nMaking a request is straightforward. Start by importing the BrazilCEP module:\n\n```python\n>>> import brazilcep\n```\n\nNext, use the `get_address_from_cep` function to query any CEP:\n\n```python\n>>> address = brazilcep.get_address_from_cep('37503-130')\n```\n\nThe result is a dictionary containing the address details:\n\n```python\n>>> address\n{\n 'district': 'rua abc',\n 'cep': '37503130',\n 'city': 'city ABC',\n 'street': 'str',\n 'uf': 'str',\n 'complement': 'str',\n}\n```\n\nThe CEP must always be provided as a string.\n\n> [!TIP]\n> BrazilCEP is designed for on-demand queries in web applications. Bulk querying through scripts or other means is discouraged.\n\n> [!IMPORTANT]\n> BrazilCEP does not guarantee the availability or support of any third-party query APIs. This library serves as a convenient interface for accessing these services.\n\n#### Asynchronous Requests with BrazilCEP\n\nBrazilCEP (version >= 7.0.0) also supports asynchronous operations , allowing you to retrieve address information for a given CEP without blocking your application. This is particularly useful for web applications or services that require high responsiveness.\n\nTo perform an asynchronous request, use the `async_get_address_from_cep` function:\n\n```python\nimport asyncio\nimport brazilcep\n\nasync def main():\n address = await brazilcep.async_get_address_from_cep('37503-130')\n print(address)\n\nasyncio.run(main())\n```\n> [!NOTE]\n> This function is asynchronous and must be awaited when called.\n> Ensure that your environment supports asynchronous programming before using this function.\n\n## Documentation\n\nComprehensive documentation for BrazilCEP is available on [ReadTheDocs](https://brazilcep.readthedocs.io/).\n\n## Contribute\n\nTo contribute, follow the guidelines outlined [here](https://brazilcep.readthedocs.io/contributing.html).\n\n## Credits\n\nCopyright (C) 2016-2024 by Michell Stuttgart\n",
"bugtrack_url": null,
"license": "MIT License\n \n Copyright (c) 2016-2024, Michell Stuttgart\n \n Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n ",
"summary": "Minimalist and easy-to-use Python library designed to query CEP (Postal Address Code) data",
"version": "7.0.1",
"project_urls": {
"Changelog": "https://github.com/mstuttgart/brazilcep/blob/main/CHANGELOG",
"Documentation": "https://brazilcep.readthedocs.io/index.html",
"Repository": "https://github.com/mstuttgart/brazilcep",
"Tracker": "https://github.com/mstuttgart/brazilcep/issues"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "310bf75f8d8d8e8d287e492398d7488052fe1eee775fd9086e0a3f2663003371",
"md5": "453d13f1f4c07c5c8e1a9f1535745316",
"sha256": "74391e3ea8d4011c6dc2f1b97dc401fd727405e789fcce6558057257f1858a3a"
},
"downloads": -1,
"filename": "brazilcep-7.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "453d13f1f4c07c5c8e1a9f1535745316",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 15240,
"upload_time": "2025-08-16T12:21:25",
"upload_time_iso_8601": "2025-08-16T12:21:25.683531Z",
"url": "https://files.pythonhosted.org/packages/31/0b/f75f8d8d8e8d287e492398d7488052fe1eee775fd9086e0a3f2663003371/brazilcep-7.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "417f59c96238ef36418166975c51a471577cfb6a644d0eebe1b74998e80b1a4d",
"md5": "d9963ac01e9bdf50021e6c4759e36c9e",
"sha256": "1797dbc462be48a5bcb95853a735d6a4450e172ece3a3dedb2972c656b71dc98"
},
"downloads": -1,
"filename": "brazilcep-7.0.1.tar.gz",
"has_sig": false,
"md5_digest": "d9963ac01e9bdf50021e6c4759e36c9e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 16508,
"upload_time": "2025-08-16T12:21:27",
"upload_time_iso_8601": "2025-08-16T12:21:27.148128Z",
"url": "https://files.pythonhosted.org/packages/41/7f/59c96238ef36418166975c51a471577cfb6a644d0eebe1b74998e80b1a4d/brazilcep-7.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-16 12:21:27",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mstuttgart",
"github_project": "brazilcep",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "brazilcep"
}