Skip to main content

Validate brazilian documents using Type Hints in classes inheriting Pydantic's (V2) BaseModel

Project description

Test codecov PyPI - Version PyPI - Python Version Pydantic V2

Install

pip install brdocs-validation

Supported docs and its formats

Supports Description Format Format's support
CNPJ 12.345.678/9012-34 OR Without special chars
CPF 123.456.789-01 OR Without special chars
CNH Only numbers Length: 11
NIS/PIS/PASEP/NIT Use NIS type for PIS, PASEP, NIT 123.45678.90-1 OR Only numbers
CNS Cartão Nacional de Saúde Only numbers
RENAVAM Only numbers Length: 9, 10 & 11
TE Título de eleitor Only numbers
CERT Certidão de casamento, nascimento e óbito Only numbers

Usage

from br_docs import CNPJ, CPF, CNH, NIS, CNS, RENAVAM, TE, CERT
from pydantic import BaseModel


class User(BaseModel):
    cpf: CPF
    cnpj: CNPJ
    cnh: CNH
    nis: NIS
    cns: CNS
    renavam: RENAVAM
    te: TE
    cert: CERT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

brdocs-validation-0.3.0.tar.gz (8.1 kB view hashes)

Uploaded Source

Built Distribution

brdocs_validation-0.3.0-py3-none-any.whl (9.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page