semvec/pypi-packages huggingface dataset:
pydantic-br-validator 0.9.0
Uma biblioteca python com modelos de validação para os principais documentos brasileiros
Requires Python: >=3.9

# Pydantic BR Validator 🇧🇷

<p align="center">
    <em>Uma biblioteca python com modelos de validação para os principais documentos brasileiros.</em>
</p>
<p align="center">
<a href="https://github.com/hudsonbrendon/pydantic-br-validator/actions/workflows/pythonpackage.yml" target="_blank">
    <img src="https://github.com/hudsonbrendon/pydantic-br-validator/actions/workflows/pythonpackage.yml/badge.svg?branch=master" alt="Test">
</a>
<a href="https://pypi.org/project/pydantic-br-validator" target="_blank">
    <img src="https://img.shields.io/pypi/v/pydantic-br-validator?color=%2334D058&label=pypi%20package" alt="Package version">
</a>
<a href="https://pypi.org/project/pydantic-br-validator" target="_blank">
    <img src="https://img.shields.io/pypi/pyversions/pydantic-br-validator.svg?color=%2334D058" alt="Supported Python versions">
</a>
</p>

---

# Instalação

```bash
pip install pydantic-br-validator
```
ou
```bash
uv add pydantic-br-validator
```

# Campos disponíveis

- [x] CPF
- [x] CNPJ
- [x] RG
- [x] CNH
- [ ] DUT
- [ ] Título de eleitor
- [ ] PIS
- [ ] Certidão de nascimento
- [ ] Renavam
- [ ] Placa
- [ ] ISBN
- [x] CEP

# Exemplos

## CPF

```python
from pprint import pprint

from pydantic import BaseModel

from pydantic_br_validator import CPF, CPFDigits, CPFMask


class Cliente(BaseModel):
    nome: str
    cpf: CPF  # aceita CPF válidos com ou sem máscara
    cpf_mask: CPFMask  # aceita CPF válido apenas com máscara
    cpf_digits: CPFDigits  # aceita CPF válido apenas com dígitos


cliente = Cliente(
    nome="Hudson", cpf="04120039021", cpf_mask="041.200.390-21", cpf_digits="04120039021"
)


pprint(cliente.dict())
```

## CNPJ

```python
from pprint import pprint

from pydantic import BaseModel

from pydantic_br_validator import CNPJ, CNPJDigits, CNPJMask


class Cliente(BaseModel):
    nome: str
    cnpj: CNPJ  # aceita CNPJ válidos com ou sem máscara
    cnpj_mask: CNPJMask  # aceita CNPJ válido apenas com máscara
    cnpj_digits: CNPJDigits  # aceita CNPJ válido apnas com dígitos


cliente = Cliente(
    nome="Hudson", cnpj="47895328000187", cnpj_mask="47.895.328/0001-87", cnpj_digits="47895328000187"
)


pprint(cliente.dict())
```

# CEP

```python
from pprint import pprint

from pydantic import BaseModel

from pydantic_br_validator import CEP, CEPDigits, CEPMask


class Endereco(BaseModel):
    rua: str
    numero: str
    bairro: str
    cidade: str
    cep: CEP  # aceita CEP válidos com ou sem máscara
    cep_mask: CEPMask  # aceita CEP válido apenas com máscara
    cep_digits: CEPDigits  # aceita CEP válido apnas com dígitos


endereco = Endereco(
    rua="Avenida Paulista",
    numero="100",
    bairro="Aclimação",
    cidade="São Paulo",
    cep="01310100",
    cep_mask="01310-100",
    cep_digits="01310100",
)


pprint(endereco.dict())
```

# Licença

Este projeto está licenciado sob os termos da licença do [MIT licença](https://en.wikipedia.org/wiki/MIT_License)
tabeline 0.6.3
A data frame and data grammar library
Requires Python: <4.0,>=3.10
Keywords: dataframe, datatable, datagrammar, dplyr

# Tabeline

Tabeline is a data frame and data grammar library. You write the expressions in strings and supply them to methods on the `DataFrame` class. The strings are parsed by Parsita and converted into Polars for execution.

Tabeline draws inspiration from dplyr, the data grammar of R's tidyverse, especially for its methods names. The `filter`, `mutate`, `group_by`, and `summarize` methods should all feel familiar. But Tabeline is as proper a Python library as can be, using methods instead of pipes, like is standard in R. 

Tabeline uses Polars under the hood, but adds a lot of handling of edge cases from Polars, which otherwise result in crashes or behavior that is not type stable.

See the [Documentation](https://tabeline.drhagen.com) for the full user guide.

## Installation

It is recommended to install Tabeline from PyPI using `pip`.

```shell
pip install tabeline
```

## Motivating example

```python
from tabeline import DataFrame

# Construct a data frame using clean syntax
# from_csv, from_pandas, and from_polars are also available 
df = DataFrame(
    id=[0, 0, 0, 0, 1, 1, 1, 1, 1],
    t=[0, 6, 12, 24, 0, 6, 12, 24, 48],
    y=[0, 2, 3, 1, 0, 4, 3, 2, 1],
)

# Use data grammar methods and string expressions to define
# transformed data frames
analysis = (
    df
    .filter("t <= 24")
    .group_by("id")
    .summarize(auc="trapz(t, y)")
)

print(analysis)
# shape: (2, 2)
# ┌─────┬──────┐
# │ id  ┆ auc  │
# │ --- ┆ ---  │
# │ i64 ┆ f64  │
# ╞═════╪══════╡
# │ 0   ┆ 45.0 │
# ├╌╌╌╌╌┼╌╌╌╌╌╌┤
# │ 1   ┆ 63.0 │
# └─────┴──────┘
```