Skip to content

Commit

Permalink
Add migration session in the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mstuttgart committed May 1, 2023
1 parent b186a35 commit 64feb2f
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 13 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ the integration of Python applications with these services.
* [ApiCEP (WideNet)](https://apicep.com)
* [Correios (SIGEPWeb)](http://www.corporativo.correios.com.br/encomendas/sigepweb/doc/Manual_de_Implementacao_do_Web_Service_SIGEP_WEB.pdf)

BrazilCEP started as a personal study project and evolved into a serious and open source project that is used by many developers on a daily basis.
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](https://brazilcep.readthedocs.io/en/latest/migrate/) section in docs.

## Install

Expand Down Expand Up @@ -97,7 +98,7 @@ The CEP always must be a string.

## Documentation

Documentation for the current version of BrazilCEP is available from the official docs [here](https://brazilcep.readthedocs.io/).
Documentation for the current version of BrazilCEP is available from the official docs [here](https://brazilcep.readthedocs.io/en/stable).

## Contribute

Expand Down
2 changes: 1 addition & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changelog

## 6.0.0 (2023-04-30)
## 6.0.0 (2023-05-01)

- Rename lib to BrazilCEP
- Create new pip package
Expand Down
2 changes: 1 addition & 1 deletion docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# How to Contribute
# Contribute

Contributions are welcome and greatly appreciated!

Expand Down
9 changes: 5 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ Its objective is to provide a common query interface to all these search service
}
```

!!! tip

**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](/migrate) section.

## Features

* Cross-platform: Windows, Mac, and Linux are officially supported.
Expand All @@ -50,7 +55,3 @@ Its objective is to provide a common query interface to all these search service
* [Correios (SIGEPWeb)](http://www.corporativo.correios.com.br/encomendas/sigepweb/doc/Manual_de_Implementacao_do_Web_Service_SIGEP_WEB.pdf)

BrazilCEP started as a personal study project and evolved into a serious and open source project that is used by many developers on a daily basis.

!!! info
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.
67 changes: 67 additions & 0 deletions docs/migrate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Migrate

**BrazilCEP** is tne new name of former **PycepCorreios**. This page
guide you on to process of migrate old code to new version.

It's simples migrate te code and require minimal steps.

## imports

First, rename the `import` statements from:

```python title="PyCEPCorreios"
import pycepicorreios
```
to

```python title="BrazilCEP"
import brazilcep
```

## Query results

The next step, is adjust the *keys* of query returned by `get_address_from_cep` function.

The keys have simply been translated to english. Take a look on this old code:

``` python title="PyCEPCorreios"
>>> get_address_from_cep('37503-130')
{
'bairro': 'rua abc',
'cep': '37503130',
'cidade': 'city ABC',
'logradouro': 'str',
'uf': 'str',
'complemento': 'str',
}
```
This is the new code:

``` python title="BrazilCEP"
>>> get_address_from_cep('37503-130')
{
'district': 'rua abc',
'cep': '37503130',
'city': 'city ABC',
'street': 'str',
'uf': 'str',
'complement': 'str',
}
```

## Exceptions

The follow Exceptions have been removed.

```python
exceptions.ConnectionError
exceptions.Timeout
exceptions.HTTPError
exceptions.BaseException
```

Please, use the [requests](https://requests.readthedocs.io/en/latest/user/quickstart/#errors-and-exceptions) exceptions instead.

## Questions?

The best way to send question is open a issue in **BrazilCEP** issue tracker [here](https://github.com/mstuttgart/brazilcep/issues).
5 changes: 5 additions & 0 deletions docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ The CEP always must be a string.
BrazilCEP was developed to integrate on-demand queries into web pages.
Querying CEP in bulk through scripts or any other means is not recommended.

!!! info

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.

By default, BrazilCEP uses the API provided by the [ApiCEP](https://apicep.com) service.
To use other services, we must indicate the desired service when calling the `get_address_from_cep`
function.
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ nav:
- Home: 'index.md'
- 'install.md'
- 'tutorial.md'
- 'migrate.md'
- 'CONTRIBUTING.md'
- 'CHANGELOG.md'

Expand Down
9 changes: 4 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]
name = "brazilcep"
version = "6.0.0-a2"
description = "Python library to query brazilian CEP (brazilian zip codes) data"
version = "6.0.0"
description = "Minimalist and easy-to-use python library designed to query CEP (brazilian zip codes) data"
authors = ["Michell Stuttgart <michellstut@gmail.com>"]
license = "MIT"
readme = "README.md"
Expand All @@ -15,7 +15,7 @@ classifiers = [
"Topic :: Software Development :: Libraries :: Python Modules",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Development Status :: 3 - Alpha",
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
Expand All @@ -24,7 +24,6 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Internet :: WWW/HTTP :: HTTP Servers",
"Topic :: Software Development :: Libraries",
"Natural Language :: English",
"Natural Language :: Portuguese (Brazilian)",
Expand All @@ -33,7 +32,7 @@ classifiers = [
[tool.poetry.urls]
"Repository" = "https://github.com/mstuttgart/brazilcep"
"Bug Tracker" = "https://github.com/mstuttgart/brazilcep/issues"
"Documentation" = "https://brazilcep.readthedocs.io/en/latest/"
"Documentation" = "https://brazilcep.readthedocs.io/en/stable/"
"Donation" = "https://ko-fi.com/mstuttgart"

[tool.poetry.dependencies]
Expand Down

0 comments on commit 64feb2f

Please sign in to comment.