Skip to content

Commit

Permalink
Change default webservice to 'OPENCEP'
Browse files Browse the repository at this point in the history
  • Loading branch information
mstuttgart committed Nov 25, 2024

Verified

This commit was signed with the committer’s verified signature.
bashbunni bashbunni
1 parent ec7fadf commit 21d85a4
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion brazilcep/client.py
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@ class WebService(enum.Enum):

def get_address_from_cep(
cep: str,
webservice: WebService = WebService.APICEP,
webservice: WebService = WebService.OPENCEP,
timeout: Optional[int] = None,
proxies: Optional[dict] = None,
) -> dict:
9 changes: 2 additions & 7 deletions docs/source/user/quickstart.rst
Original file line number Diff line number Diff line change
@@ -50,12 +50,7 @@ Timeouts
You can tell BrazilCEP to stop waiting for a response after a given number of
seconds with the ``timeout`` parameter. Nearly all production code should use
this parameter in nearly all requests. Failure to do so can cause your program
to hang indefinitely::

>>> get_address_from_cep('37503-130', timeout=0.001)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
requests.exceptions.Timeout: HTTPConnectionPool(host='http://www.viacep.com.br/ws/37503130/json', port=80): Request timed out. (timeout=0.001)
to hang indefinitely.

Proxy
-----
@@ -87,7 +82,7 @@ Unsing differents API's
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.
By default, BrazilCEP uses the API provided by the `OpenCEP <https://opencep.com>`_ service.

To use other services, we must indicate the desired service when calling the `get_address_from_cep`
function.

0 comments on commit 21d85a4

Please sign in to comment.