Skip to content

Commit

Permalink
docs: create a folder with old documentation (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniamaia committed Apr 15, 2023
1 parent 5f6669e commit e19c7be
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
[![Downloads per Month](https://shields.io/pypi/dm/brutils)](https://pypi.org/project/brutils/)
[![Package version](https://shields.io/pypi/v/brutils)](https://pypi.org/project/brutils/)
### [Procurando pela versão em português?](README_PT_BR.md)
### [Looking for 1.0.1 version documentation?](/documentation%20v1.0.1/ENGLISH_VERSION.md)

</div>

Expand Down
1 change: 1 addition & 0 deletions README_PT_BR.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
[![Package version](https://shields.io/pypi/v/brutils)](https://pypi.org/project/brutils/)

### [Looking for the english version?](README.md)
### [Procurando a documentação da versão 1.0.1?](/documentation%20v1.0.1/PORTUGUESE_VERSION.md)
</div>

# Introdução
Expand Down
72 changes: 72 additions & 0 deletions documentation v1.0.1/ENGLISH_VERSION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# brutils

### [Procurando pela versão em português?](PORTUGUESE_VERSION.md)

_Compatible with Python 2.7 and 3.x_

`brutils` is a library for validating brazilian document numbers, and might
eventually evolve to deal with other validations related to brazilian bureaucracy.

It's main functionality is the validation of CPF and CNPJ numbers, but suggestions
for other (preferrably deterministic) things to validate are welcome.


## Installation

```
pip install brutils
```


## Utilization

### Importing:
```
>>> from brutils import cpf, cnpj
```

### How do I validate a CPF or CNPJ?
```
# numbers only, formatted as strings
>>> cpf.validate('00011122233')
False
>>> cnpj.validate('00111222000133')
False
```

### What if my string has formatting symbols in it?
```
>>> cpf.sieve('000.111.222-33')
'00011122233'
>>> cnpj.sieve('00.111.222/0001-00')
'00111222000100'
# The `sieve` function only filters out the symbols used for CPF or CNPJ validation.
# It purposefully doesn't remove other symbols, as those may be indicators of data
# corruption, or a possible lack of input filters.
```

### What if I want to format a numbers only string?
```
>>> cpf.display('00011122233')
'000.111.222-33'
>>> cnpj.display('00111222000100')
'00.111.222/0001-00'
```

### What if I want to generate random, but numerically valid CPF or CNPJ numbers?
```
>>> cpf.generate()
'17433964657'
>>> cnpj.generate()
'34665388000161'
```


## Testing

```
python2.7 -m unittest discover tests/
python3 -m unittest discover tests/
```
75 changes: 75 additions & 0 deletions documentation v1.0.1/PORTUGUESE_VERSION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# brutils

### [Looking for the english version?](ENGLISH_VERSION.md)

_Compatível com Python 2.7 e 3.x_

`brutils` é uma biblioteca para tratar de validações de documentos brasileiros,
e que eventualmente pode evoluir para tratar de outras coisas dentro do escopo
de validações relacionadas a burocracias brasileiras.

Sua principal funcionalidade é a validação de CPFs e CNPJs, mas sugestões sobre
outras coisas a se validar (preferencialmente de maneira determinística) são bem
vindas.


## Instalação

```
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')
False
>>> cnpj.validate('00111222000133')
False
```

### E se a minha string estiver formatada com simbolos?
```
>>> cpf.sieve('000.111.222-33')
'00011122233'
>>> cnpj.sieve('00.111.222/0001-00')
'00111222000100'
# A função `sieve` limpa apenas os simbolos de formatação de CPF ou CNPJ, e de
# whitespace nas pontas. Ela não remove outros caractéres propositalmente, pois
# estes seriam indicativos de uma possível corrupção no dado ou de uma falta de
# filtros de input.
```

### E se eu quiser formatar uma string numérica?
```
>>> cpf.display('00011122233')
'000.111.222-33'
>>> cnpj.display('00111222000100')
'00.111.222/0001-00'
```

### E se eu quiser gerar CPFs ou CNPJs validos aleatórios?
```
>>> cpf.generate()
'17433964657'
>>> cnpj.generate()
'34665388000161'
```


## Testes

```
python2.7 -m unittest discover tests/
python3 -m unittest discover tests/
```

0 comments on commit e19c7be

Please sign in to comment.