brazilian-utils / brutils-python Goto Github PK
View Code? Open in Web Editor NEWUtils library for specific Brazilian businesses 🇧🇷
Home Page: https://pypi.python.org/pypi/brutils
License: MIT License
Utils library for specific Brazilian businesses 🇧🇷
Home Page: https://pypi.python.org/pypi/brutils
License: MIT License
In order to make it with the same API as js brutils
Chama a função is_valid para checar o CPF, se True retorna o número com os símbolos, senão, retorna None.
In order to make it with the same API as js brutils
https://flake8.pycqa.org/en/latest/
dev
:Lines 34 to 36 in ddb26d9
make format
. Análogo ao black: Line 12 in ddb26d9
O comando make format deve rodar tanto o black quanto o flake8, algo como:
format:
@poetry run black -l 80 . --exclude=.venv
@poetry run flake8
Talvez "remove_symbols", "remove_symbols_cpf" e "remove_symbols_cnpj"?
Implementar um utilitário que recebe um CEP apenas com dígitos e retorna o CEP com símbolos (ponto e traço)
Implementar um utilitário que valida CEPs
CODE_OF_CONDUCT.md
. Ele deve conter o Código de Conduta do repositório em português.CODE_OF_CONDUCT_EN.md
. Ele deve conter o Código de Conduta do repositório em inglês.Sobre Código de Conduta:
Exemplos:
Atualmente só está rodando quando acontece um push
Add a github action to automatically publish the package into Pypi. This way, we skip a manual process and we don't need to give pypi access to more people.
Example:
https://github.com/scanapi/scanapi/blob/master/.github/workflows/publish-to-pypi.yml
Implementar um utilitário que recebe um CEP com símbolos (ponto e traço) e retorna esse CEP apenas com dígitos
Add a make command to auto format the code. flake8 might be a good option.
Criar mais casos de teste para o utilitário is_valid_cnpj.
Alguns exemplos:
Você pode utilizar o exemplo do CPF como base:
brutils-python/tests/test_cpf.py
Line 64 in 1b12ebf
O algoritmo considerado para validação é este: https://www.geradorcnpj.com/algoritmo_do_cnpj.htm
Lembre-se também que você pode consultar como foi feita a implementação na biblioteca JS: https://github.com/brazilian-utils/brazilian-utils/tree/main/src/utilities/cnpj
Add pytest
Some good points to start using pytest:
To map sieve
to parse_cnpj
in order to make the name compatible with the js brutils
It should be
install:
@poetry install
@poetry run pre-commit install -f -t pre-commit --hook-type commit-msg
instead of:
install:
@poetry run pre-commit install -f -t pre-commit --hook-type commit-msg
@poetry install
Format README's to make it looks like the JS API docs
Adicionar maintainers e core team como CODEOWNERs
Seguindo esses padrões: https://keepachangelog.com/en/1.0.0/
Related to #6
Chamar a função is_valid
e formatar o cnpj, sem utilizar o método display.
Código referência:
Lines 38 to 48 in 756f126
Melhorar os testes da função format_cnpj:
Código referência:
brutils-python/tests/test_cpf.py
Lines 47 to 57 in 756f126
In order to make it the same as the other methods.
@camilamaia
Adicionar instruções de como fazer uma release. Esta informação deve estar presente nos arquivos CONTRIBUTING.md e CONTRIBUTING_EN.md
O passo a passo é muito semelhante aos descritos aqui https://github.com/scanapi/scanapi/wiki/Deploy, porém desconsiderando tudo que é relacionado ao Docker ou Twitter.
Para indicar como os usuários podem interagir com a gente da melhor forma :)
ex: ao invés de : https://docs.python.org/3/library/unittest.html#test-cases mudar para utilizar assertEqual
(https://docs.python.org/3/library/unittest.html#test-cases)
in order to show older documentation to 1.0.1 version users
Rename master
branch to main
to avoid slavery references.
Add brazilian-utils header to README.md and README_EN.md files
Like this:
The same we have for JS version: https://github.com/brazilian-utils/brazilian-utils/blob/main/README.md
Code:
<div align="center">
<h1>🇧🇷 Brazilian Utils</h1>
<p>Utils library for Brazilian-specific businesses.</p>
</div>
Add .gitignore file to avoid pushing files that we should not, like:
~/workspace/brutils-python main ✗ 1h47m ◒
▶ git status
On branch main
Your branch is up to date with 'origin/main'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
brutils/__pycache__/
tests/__pycache__/
nothing added to commit but untracked files present (use "git add" to track)
In order to make it with the same API as js brutils
Add a static analysis checker to:
My suggestion: https://deepsource.io
To map sieve
to parse_cpf
in order to make the name compatible with the js brutils
Para seguir padrão.
ao invés de
class CPF(TestCase):
deveria ser:
class TestCPF(TestCase):
Add github action to run tests on every push. Example:
https://github.com/brazilian-utils/python/blob/master/.github/workflows/test.yaml
Implementar um utilitário que valida boletos
In order to make it with the same API as js brutils
Add a make command to check the code's. Related to #5
Create a changelog file. More info at: https://keepachangelog.com/en/1.0.0/
Maybe gitlint?
Ao invés de chamar os mesmos asserts do sieve, verificar se o método sieve foi chamado.
Ideia Análoga:
brutils-python/tests/test_cpf.py
Lines 35 to 39 in c741843
Add Poetry
Some good points to start using Poetry:
Implementar um utilitário que retorna um CEP aleatório válido
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.