1111############
1212
1313
14- def remove_symbols (dirty ): # type: ( str) -> str
14+ def remove_symbols (dirty : str ) -> str :
1515 """
1616 Removes specific symbols from a given CEP (Postal Code).
1717
@@ -34,7 +34,7 @@ def remove_symbols(dirty): # type: (str) -> str
3434 return "" .join (filter (lambda char : char not in ".-" , dirty ))
3535
3636
37- def format_cep (cep ): # type: ( str) -> str | None
37+ def format_cep (cep : str ) -> str | None :
3838 """
3939 Formats a Brazilian CEP (Postal Code) into a standard format.
4040
@@ -62,7 +62,7 @@ def format_cep(cep): # type: (str) -> str | None
6262############
6363
6464
65- def is_valid (cep ): # type: ( str) -> bool
65+ def is_valid (cep : str ) -> bool :
6666 """
6767 Checks if a CEP (Postal Code) is valid.
6868
@@ -92,7 +92,7 @@ def is_valid(cep): # type: (str) -> bool
9292 return isinstance (cep , str ) and len (cep ) == 8 and cep .isdigit ()
9393
9494
95- def generate (): # type: () -> str
95+ def generate () -> str :
9696 """
9797 Generates a random 8-digit CEP (Postal Code) number as a string.
9898
@@ -113,7 +113,9 @@ def generate(): # type: () -> str
113113
114114
115115# Reference: https://viacep.com.br/
116- def get_address_from_cep (cep , raise_exceptions = False ): # type: (str, bool) -> Address | None
116+ def get_address_from_cep (
117+ cep : str , raise_exceptions : bool = False
118+ ) -> Address | None :
117119 """
118120 Fetches address information from a given CEP (Postal Code) using the ViaCEP API.
119121
@@ -181,8 +183,8 @@ def get_address_from_cep(cep, raise_exceptions=False): # type: (str, bool) -> A
181183
182184
183185def get_cep_information_from_address (
184- federal_unit , city , street , raise_exceptions = False
185- ): # type: (str, str, str, bool) -> list[Address] | None
186+ federal_unit : str , city : str , street : str , raise_exceptions : bool = False
187+ ) -> list [Address ] | None :
186188 """
187189 Fetches CEP (Postal Code) options from a given address using the ViaCEP API.
188190
0 commit comments