abrasileirado 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- abrasileirado-1.0.0/LICENSE.md +21 -0
- abrasileirado-1.0.0/PKG-INFO +150 -0
- abrasileirado-1.0.0/README.md +95 -0
- abrasileirado-1.0.0/abrasileirado/__init__.py +23 -0
- abrasileirado-1.0.0/abrasileirado/enums.py +545 -0
- abrasileirado-1.0.0/abrasileirado/types.py +788 -0
- abrasileirado-1.0.0/abrasileirado.egg-info/PKG-INFO +150 -0
- abrasileirado-1.0.0/abrasileirado.egg-info/SOURCES.txt +13 -0
- abrasileirado-1.0.0/abrasileirado.egg-info/dependency_links.txt +1 -0
- abrasileirado-1.0.0/abrasileirado.egg-info/requires.txt +10 -0
- abrasileirado-1.0.0/abrasileirado.egg-info/top_level.txt +1 -0
- abrasileirado-1.0.0/pyproject.toml +62 -0
- abrasileirado-1.0.0/setup.cfg +4 -0
- abrasileirado-1.0.0/tests/test_enums.py +153 -0
- abrasileirado-1.0.0/tests/test_types.py +412 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015 kelsoncm
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: abrasileirado
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Python library specific brazilian objects and validations.
|
|
5
|
+
Author-email: Kelson da Costa Medeiros <kelsoncm@gmail.com>
|
|
6
|
+
License: # The MIT License (MIT)
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2015 kelsoncm
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://github.com/abrasileirado/python_abrasileirado
|
|
29
|
+
Project-URL: Issues, https://github.com/abrasileirado/python_abrasileirado/issues
|
|
30
|
+
Project-URL: Download, https://github.com/abrasileirado/python_abrasileirado/releases/
|
|
31
|
+
Project-URL: Docs, https://abrasileirado.github.io/python_abrasileirado/
|
|
32
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
33
|
+
Classifier: Intended Audience :: Developers
|
|
34
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
35
|
+
Classifier: Operating System :: OS Independent
|
|
36
|
+
Classifier: Programming Language :: Python :: 3
|
|
37
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
41
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
42
|
+
Requires-Python: >=3.10
|
|
43
|
+
Description-Content-Type: text/markdown
|
|
44
|
+
License-File: LICENSE.md
|
|
45
|
+
Provides-Extra: dev
|
|
46
|
+
Requires-Dist: pre-commit>=4.6.0; extra == "dev"
|
|
47
|
+
Requires-Dist: black>=26.3.1; extra == "dev"
|
|
48
|
+
Requires-Dist: ruff>=0.15.11; extra == "dev"
|
|
49
|
+
Requires-Dist: doc8>=2.0.0; extra == "dev"
|
|
50
|
+
Requires-Dist: pytest>=9.0.3; extra == "dev"
|
|
51
|
+
Requires-Dist: pytest-cov>=7.1.0; extra == "dev"
|
|
52
|
+
Requires-Dist: python-dotenv>=1.2.2; extra == "dev"
|
|
53
|
+
Requires-Dist: pytest-coverage-gate>=1.0.3; extra == "dev"
|
|
54
|
+
Dynamic: license-file
|
|
55
|
+
|
|
56
|
+
# Python BRfied
|
|
57
|
+
|
|
58
|
+

|
|
59
|
+
[](https://pypi.org/project/abrasileirado/)
|
|
60
|
+
[](https://github.com/abrasileirado/python_abrasileirado/actions/workflows/qa.yml)
|
|
61
|
+
[](https://codecov.io/gh/abrasileirado/python_abrasileirado)
|
|
62
|
+
[](https://github.com/abrasileirado/python_abrasileirado/actions/workflows/publish.yml)
|
|
63
|
+
[](https://abrasileirado.github.io/python_abrasileirado/)
|
|
64
|
+
[](https://github.com/pre-commit/pre-commit)
|
|
65
|
+
|
|
66
|
+
Python library specific brazilian objects and validations.
|
|
67
|
+
|
|
68
|
+
FAQ 1:
|
|
69
|
+
> Why I create abrasileirado? Because **this is Brazil** (Toretto, 2020).
|
|
70
|
+
|
|
71
|
+
FAQ 1:
|
|
72
|
+
> Why are classes, properties, and methods in Portuguese? (Toretto, 2020) already answered.
|
|
73
|
+
|
|
74
|
+
FAQ 1:
|
|
75
|
+
> Why not `validate-docbr`, `pycpfcnpj` or `brutils`?
|
|
76
|
+
> Because I prefer Immutable classes and here we have more types implementeds. See [comparation](https://abrasileirado.github.io/python_abrasileirado/index.html).
|
|
77
|
+
|
|
78
|
+
## Immutable classes
|
|
79
|
+
|
|
80
|
+
With validation, formating and unformating
|
|
81
|
+
|
|
82
|
+
* ✅ CEP - Código de Endereçamento Postal - Empresa de Correio e Telegráfos (ECT)
|
|
83
|
+
* ✅ EnderecoBrasil - ECT
|
|
84
|
+
* ✅ CPF - Cadastro de Pessoa Física - Receita Federal do Brasil (RFB)
|
|
85
|
+
* ✅ CNPJ - Cadastro Nacional de Pessoa Jurídica - RFB
|
|
86
|
+
* ✅ CNES - Cadastro Nacional de Estabelecimento de Saúde - DATASUS
|
|
87
|
+
* ✅ CNS - Cadastro Nacional de Saúde (Cartão SUS) - DATASUS
|
|
88
|
+
* ✅ PIS - Programa de Integração Social - Tesouro Nacional
|
|
89
|
+
* ✅ RENAVAM - Registro Nacional de Veículos Automotores - Secretaria Nacional de Trânsito (Senatran)
|
|
90
|
+
* ✅ TituloEleitoral - Tribunal Superior Eleitoral - TSE
|
|
91
|
+
* ✅ Telefone - Agência Nacional de Telecomunicações (Anatel)
|
|
92
|
+
* ✅ Passaporte - Polícia Federal (PF)
|
|
93
|
+
* ✅ PlacaVeicular - Conselho Nacional de Trânsito (CONTRAN)
|
|
94
|
+
* ✅ NUP - Número Único de Processo - Conselho Nacional de Justiça (CNJ)
|
|
95
|
+
* ✅ CertidaoRCPN - Certidão de nascimento, casamento e outros - Conselho Nacional de Justiça (CNJ)
|
|
96
|
+
|
|
97
|
+
CEP, EnderecoBrasil, CPF, CNPJ, CNH, CNS, CNES, PIS, RENAVAM, Titulo
|
|
98
|
+
eleitoral, NUP, Telefone, Passaporte, Placa veicular, Certidão
|
|
99
|
+
|
|
100
|
+
## Enums
|
|
101
|
+
|
|
102
|
+
In accordance with regulatory bodies
|
|
103
|
+
|
|
104
|
+
* ✅ Sim/Não (Enum)
|
|
105
|
+
* ✅ Estado Civil (Enum) - Instituto Brasileiro de Geografia e Estatística (IBGE)
|
|
106
|
+
* ✅ Cor/Raça (Enum) - IBGE
|
|
107
|
+
* ✅ Sexo (Enum) - IBGE
|
|
108
|
+
* ✅ Gênero (Enum) - IBGE*
|
|
109
|
+
* ✅ Deficiência (Enum) - IBGE
|
|
110
|
+
* ✅ Zona de habitação (Enum) - IBGE
|
|
111
|
+
* ✅ Região geopolítica (Enum) - IBGE
|
|
112
|
+
* ✅ Unidade federativa (Enum) - IBGE
|
|
113
|
+
* ✅ Grupo de natureza jurídica (Enum) - IBGE
|
|
114
|
+
* ✅ Natureza jurídica (Enum) - IBGE
|
|
115
|
+
|
|
116
|
+
* 🚫 Modulo11
|
|
117
|
+
* 🚫 ProtocoloIntegrado
|
|
118
|
+
* 🚫 ProtocoloJustica
|
|
119
|
+
* 🚫 PJE
|
|
120
|
+
* 🚫 Boleto
|
|
121
|
+
* 🚫 NFE
|
|
122
|
+
* 🚫 Municipio
|
|
123
|
+
|
|
124
|
+
## Validações e formatações
|
|
125
|
+
|
|
126
|
+
* [x] validate_masked_value
|
|
127
|
+
* [x] validate_cpf
|
|
128
|
+
* [x] validate_cnpj
|
|
129
|
+
* [x] validate_mask
|
|
130
|
+
* [x] validate_mod11
|
|
131
|
+
* [x] validate_dv_by_mask
|
|
132
|
+
* [ ] CEP
|
|
133
|
+
* [ ] Data
|
|
134
|
+
* [ ] Hora
|
|
135
|
+
* [ ] Data e hora
|
|
136
|
+
* [ ] CNES
|
|
137
|
+
* [ ] CNS
|
|
138
|
+
* [ ] Protocolo integrado (<https://protocolointegrado.gov.br/Protocolo/projeto.jsf>)
|
|
139
|
+
* [ ] Protocolo justiça (<https://www.conjur.com.br/2009-jan-23/cnj-define-padrao-numeracao-processos-todos-tribunais>
|
|
140
|
+
<http://www.stf.jus.br/portal/cms/verTexto.asp?servico=processoPeticaoEletronica&pagina=Informacoes_gerais_apos_desligamento_v1>)
|
|
141
|
+
* [ ] PJe
|
|
142
|
+
* [ ] Linha digitável de boleto
|
|
143
|
+
* [ ] Código de barra de boleto
|
|
144
|
+
* [ ] Linha digitável de título
|
|
145
|
+
* [ ] Código de barra de título
|
|
146
|
+
* [ ] Nota fiscal eletrônica
|
|
147
|
+
* [ ] Código de município do IBGE (<https://github.com/chinnonsantos/sql-paises-estados-cidades>
|
|
148
|
+
<https://concla.ibge.gov.br/classificacoes/por-tema/codigo-de-areas/codigo-de-areas>)
|
|
149
|
+
* [ ] is_only_digits
|
|
150
|
+
* [ ] apply_mask
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
# Python BRfied
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
[](https://pypi.org/project/abrasileirado/)
|
|
5
|
+
[](https://github.com/abrasileirado/python_abrasileirado/actions/workflows/qa.yml)
|
|
6
|
+
[](https://codecov.io/gh/abrasileirado/python_abrasileirado)
|
|
7
|
+
[](https://github.com/abrasileirado/python_abrasileirado/actions/workflows/publish.yml)
|
|
8
|
+
[](https://abrasileirado.github.io/python_abrasileirado/)
|
|
9
|
+
[](https://github.com/pre-commit/pre-commit)
|
|
10
|
+
|
|
11
|
+
Python library specific brazilian objects and validations.
|
|
12
|
+
|
|
13
|
+
FAQ 1:
|
|
14
|
+
> Why I create abrasileirado? Because **this is Brazil** (Toretto, 2020).
|
|
15
|
+
|
|
16
|
+
FAQ 1:
|
|
17
|
+
> Why are classes, properties, and methods in Portuguese? (Toretto, 2020) already answered.
|
|
18
|
+
|
|
19
|
+
FAQ 1:
|
|
20
|
+
> Why not `validate-docbr`, `pycpfcnpj` or `brutils`?
|
|
21
|
+
> Because I prefer Immutable classes and here we have more types implementeds. See [comparation](https://abrasileirado.github.io/python_abrasileirado/index.html).
|
|
22
|
+
|
|
23
|
+
## Immutable classes
|
|
24
|
+
|
|
25
|
+
With validation, formating and unformating
|
|
26
|
+
|
|
27
|
+
* ✅ CEP - Código de Endereçamento Postal - Empresa de Correio e Telegráfos (ECT)
|
|
28
|
+
* ✅ EnderecoBrasil - ECT
|
|
29
|
+
* ✅ CPF - Cadastro de Pessoa Física - Receita Federal do Brasil (RFB)
|
|
30
|
+
* ✅ CNPJ - Cadastro Nacional de Pessoa Jurídica - RFB
|
|
31
|
+
* ✅ CNES - Cadastro Nacional de Estabelecimento de Saúde - DATASUS
|
|
32
|
+
* ✅ CNS - Cadastro Nacional de Saúde (Cartão SUS) - DATASUS
|
|
33
|
+
* ✅ PIS - Programa de Integração Social - Tesouro Nacional
|
|
34
|
+
* ✅ RENAVAM - Registro Nacional de Veículos Automotores - Secretaria Nacional de Trânsito (Senatran)
|
|
35
|
+
* ✅ TituloEleitoral - Tribunal Superior Eleitoral - TSE
|
|
36
|
+
* ✅ Telefone - Agência Nacional de Telecomunicações (Anatel)
|
|
37
|
+
* ✅ Passaporte - Polícia Federal (PF)
|
|
38
|
+
* ✅ PlacaVeicular - Conselho Nacional de Trânsito (CONTRAN)
|
|
39
|
+
* ✅ NUP - Número Único de Processo - Conselho Nacional de Justiça (CNJ)
|
|
40
|
+
* ✅ CertidaoRCPN - Certidão de nascimento, casamento e outros - Conselho Nacional de Justiça (CNJ)
|
|
41
|
+
|
|
42
|
+
CEP, EnderecoBrasil, CPF, CNPJ, CNH, CNS, CNES, PIS, RENAVAM, Titulo
|
|
43
|
+
eleitoral, NUP, Telefone, Passaporte, Placa veicular, Certidão
|
|
44
|
+
|
|
45
|
+
## Enums
|
|
46
|
+
|
|
47
|
+
In accordance with regulatory bodies
|
|
48
|
+
|
|
49
|
+
* ✅ Sim/Não (Enum)
|
|
50
|
+
* ✅ Estado Civil (Enum) - Instituto Brasileiro de Geografia e Estatística (IBGE)
|
|
51
|
+
* ✅ Cor/Raça (Enum) - IBGE
|
|
52
|
+
* ✅ Sexo (Enum) - IBGE
|
|
53
|
+
* ✅ Gênero (Enum) - IBGE*
|
|
54
|
+
* ✅ Deficiência (Enum) - IBGE
|
|
55
|
+
* ✅ Zona de habitação (Enum) - IBGE
|
|
56
|
+
* ✅ Região geopolítica (Enum) - IBGE
|
|
57
|
+
* ✅ Unidade federativa (Enum) - IBGE
|
|
58
|
+
* ✅ Grupo de natureza jurídica (Enum) - IBGE
|
|
59
|
+
* ✅ Natureza jurídica (Enum) - IBGE
|
|
60
|
+
|
|
61
|
+
* 🚫 Modulo11
|
|
62
|
+
* 🚫 ProtocoloIntegrado
|
|
63
|
+
* 🚫 ProtocoloJustica
|
|
64
|
+
* 🚫 PJE
|
|
65
|
+
* 🚫 Boleto
|
|
66
|
+
* 🚫 NFE
|
|
67
|
+
* 🚫 Municipio
|
|
68
|
+
|
|
69
|
+
## Validações e formatações
|
|
70
|
+
|
|
71
|
+
* [x] validate_masked_value
|
|
72
|
+
* [x] validate_cpf
|
|
73
|
+
* [x] validate_cnpj
|
|
74
|
+
* [x] validate_mask
|
|
75
|
+
* [x] validate_mod11
|
|
76
|
+
* [x] validate_dv_by_mask
|
|
77
|
+
* [ ] CEP
|
|
78
|
+
* [ ] Data
|
|
79
|
+
* [ ] Hora
|
|
80
|
+
* [ ] Data e hora
|
|
81
|
+
* [ ] CNES
|
|
82
|
+
* [ ] CNS
|
|
83
|
+
* [ ] Protocolo integrado (<https://protocolointegrado.gov.br/Protocolo/projeto.jsf>)
|
|
84
|
+
* [ ] Protocolo justiça (<https://www.conjur.com.br/2009-jan-23/cnj-define-padrao-numeracao-processos-todos-tribunais>
|
|
85
|
+
<http://www.stf.jus.br/portal/cms/verTexto.asp?servico=processoPeticaoEletronica&pagina=Informacoes_gerais_apos_desligamento_v1>)
|
|
86
|
+
* [ ] PJe
|
|
87
|
+
* [ ] Linha digitável de boleto
|
|
88
|
+
* [ ] Código de barra de boleto
|
|
89
|
+
* [ ] Linha digitável de título
|
|
90
|
+
* [ ] Código de barra de título
|
|
91
|
+
* [ ] Nota fiscal eletrônica
|
|
92
|
+
* [ ] Código de município do IBGE (<https://github.com/chinnonsantos/sql-paises-estados-cidades>
|
|
93
|
+
<https://concla.ibge.gov.br/classificacoes/por-tema/codigo-de-areas/codigo-de-areas>)
|
|
94
|
+
* [ ] is_only_digits
|
|
95
|
+
* [ ] apply_mask
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"""
|
|
2
|
+
abrasileirado
|
|
3
|
+
=============
|
|
4
|
+
|
|
5
|
+
Uma biblioteca Python para objetos, enums e validações específicas do contexto brasileiro.
|
|
6
|
+
|
|
7
|
+
Principais recursos:
|
|
8
|
+
-------------------
|
|
9
|
+
- Enums para Sim/Não, Estado Civil, Cor/Raça, Sexo, Gênero, Deficiência, Zona de Habitação, Região Geopolítica,
|
|
10
|
+
Unidade Federativa, entre outros, baseados em padrões do IBGE e órgãos oficiais.
|
|
11
|
+
- Tipos e validações para documentos e códigos nacionais: CEP, CNES, CNS, CPF, CNPJ, etc.
|
|
12
|
+
- Utilitários para validação e formatação de máscaras, dígitos e códigos brasileiros.
|
|
13
|
+
|
|
14
|
+
Por que "abrasileirado"?
|
|
15
|
+
------------------------
|
|
16
|
+
Porque **isso é Brasil** (Toretto, 2020). A proposta é facilitar o desenvolvimento de aplicações que lidam com dados
|
|
17
|
+
nacionais, promovendo padronização e segurança.
|
|
18
|
+
|
|
19
|
+
Documentação completa: https://abrasileirado.github.io/python_abrasileirado/
|
|
20
|
+
Repositório: https://github.com/abrasileirado/python_abrasileirado
|
|
21
|
+
Autor: Kelson da Costa Medeiros
|
|
22
|
+
Licença: MIT
|
|
23
|
+
"""
|