Repository: brazilian-utils/brutils-python (python)

Issue:
Add `isValidCPF ` method
In order to make it with the same API as [js brutils](https://brazilian-utils.com.br/#/utilities?id=isvalidcpf)

Pull request:
feat: is_valid_cpf
Closes #33 

Patch:
diff --git a/Makefile b/Makefile
index d095d4f..47a1870 100644
--- a/Makefile
+++ b/Makefile
@@ -15,4 +15,4 @@ check:
 	@poetry run black -l 80 --check . --exclude=.venv
 
 test:
-	@poetry run python3 -m unittest discover tests/
+	@poetry run python3 -m unittest discover tests/ -v
diff --git a/README.md b/README.md
index 8dd208d..ff1d267 100644
--- a/README.md
+++ b/README.md
@@ -26,16 +26,13 @@ pip install brutils
 
 ## Usage
 
-### Importing:
-```
->>> from brutils import cpf, cnpj
-```
-
 ### How do I validate a CPF or CNPJ?
 ```
 # numbers only, formatted as strings
 
->>> cpf.validate('00011122233')
+>>> from brutils import cnpj
+>>> from brutils.cpf import is_valid_cpf
+>>> is_valid_cpf('00011122233')
 False
 >>> cnpj.validate('00111222000133')
 False
diff --git a/README_PT_BR.md b/README_PT_BR.md
index 20de35f..8a7d394 100644
--- a/README_PT_BR.md
+++ b/README_PT_BR.md
@@ -28,16 +28,13 @@ pip install brutils
 
 ## Utilização
 
-### Importando a Biblioteca:
-```
->>> from brutils import cpf, cnpj
-```
-
 ### Como faço para validar um CPF ou CNPJ?
 ```
 # somente numeros, em formato string
 
->>> cpf.validate('00011122233')
+>>> from brutils import cnpj
+>>> from brutils.cpf import is_valid_cpf
+>>> is_valid_cpf('00011122233')
 False
 >>> cnpj.validate('00111222000133')
 False
diff --git a/brutils/cpf.py b/brutils/cpf.py
index df2d098..9b4486d 100644
--- a/brutils/cpf.py
+++ b/brutils/cpf.py
@@ -71,6 +71,17 @@ def validate(cpf):  # type: (str) -> bool
     return all(hashdigit(cpf, i + 10) == int(v) for i, v in enumerate(cpf[9:]))
 
 
+def is_valid_cpf(cpf):  # type: (str) -> bool
+    """
+    Returns whether or not the verifying checksum digits of the
+    given `cpf` match it's base number. Input should be a digit
+    string of proper length.
+    Using this method name to match with the js library  api.
+    Using the same method to ensure backwards compatibility.
+    """
+    return validate(cpf)
+
+
 def generate():  # type: () -> str
     """Generates a random valid CPF digit string."""
     base = str(randint(1, 999999998)).zfill(9)


Test patch:
diff --git a/tests/test_cpf.py b/tests/test_cpf.py
index d339b16..322f08d 100644
--- a/tests/test_cpf.py
+++ b/tests/test_cpf.py
@@ -8,7 +8,15 @@ range = range if version_info.major >= 3 else xrange
 path.insert(
     1, abspath(join(dirname(abspath(getsourcefile(lambda: 0))), pardir))
 )
-from brutils.cpf import sieve, display, hashdigit, checksum, validate, generate
+from brutils.cpf import (
+    sieve,
+    display,
+    hashdigit,
+    checksum,
+    validate,
+    generate,
+    is_valid_cpf,
+)
 from unittest import TestCase, main
 
 
@@ -42,6 +50,11 @@ class CPF(TestCase):
         assert validate("52599927765")
         assert not validate("00000000000")
 
+    def test_is_valid_cpf(self):
+        assert is_valid_cpf("52513127765")
+        assert is_valid_cpf("52599927765")
+        assert not is_valid_cpf("00000000000")
+
     def test_generate(self):
         for i in range(1000):
             assert validate(generate())