All Projects → matheuscas → Pycpfcnpj

matheuscas / Pycpfcnpj

Licence: mit
Python module for brazilian register numbers for persons (CPF) and companies (CNPJ).

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pycpfcnpj

cnpj
🇧🇷 Format, validate and generate CNPJ numbers in Node & Deno
Stars: ✭ 26 (-77.59%)
Mutual labels:  validation, generation
Vue Formulate
⚡️ The easiest way to build forms with Vue.
Stars: ✭ 1,947 (+1578.45%)
Mutual labels:  validation, generation
Flask pydantic
flask extension for integration with the awesome pydantic package
Stars: ✭ 96 (-17.24%)
Mutual labels:  validation
Typical
Typical: Fast, simple, & correct data-validation using Python 3 typing.
Stars: ✭ 111 (-4.31%)
Mutual labels:  validation
Postguard
🐛 Statically validate Postgres SQL queries in JS / TS code and derive schemas.
Stars: ✭ 104 (-10.34%)
Mutual labels:  validation
Angular Multi Step Wizard
Tutorials on building an Angular 4 Multi-Step Wizard with its own Router
Stars: ✭ 96 (-17.24%)
Mutual labels:  validation
Validator
Drop in user input validation for your iOS apps.
Stars: ✭ 1,444 (+1144.83%)
Mutual labels:  validation
Ngx Dynamic Form Builder
FormBuilder + class-transformer + class-validator = dynamic form group builder for Angular10+
Stars: ✭ 93 (-19.83%)
Mutual labels:  validation
Kronky
Kronky bridges the gap between Ecto and Absinthe GraphQL by listing validation messages in a mutation payload.
Stars: ✭ 112 (-3.45%)
Mutual labels:  validation
Accept values for
Rspec matchers to test ActiveModel validation that follows BDD.
Stars: ✭ 103 (-11.21%)
Mutual labels:  validation
Vala
A simple, extensible, library to make argument validation in Go palatable.
Stars: ✭ 109 (-6.03%)
Mutual labels:  validation
Gltf Asset Generator
Tool for generating various glTF assets for importer validation
Stars: ✭ 103 (-11.21%)
Mutual labels:  validation
Vue Pwa Asset Generator
PWA asset generator perfect with VueJS framework (but useful for all PWA!)
Stars: ✭ 97 (-16.38%)
Mutual labels:  generation
Validatorjs
A data validation library in JavaScript for the browser and Node.js, inspired by Laravel's Validator.
Stars: ✭ 1,534 (+1222.41%)
Mutual labels:  validation
Graphql Go Tools
Tools to write high performance GraphQL applications using Go/Golang.
Stars: ✭ 96 (-17.24%)
Mutual labels:  validation
Inapppy
Python In-app purchase validator for Apple AppStore and GooglePlay.
Stars: ✭ 110 (-5.17%)
Mutual labels:  validation
Validates timeliness
Date and time validation plugin for ActiveModel and Rails. Supports multiple ORMs and allows custom date/time formats.
Stars: ✭ 1,319 (+1037.07%)
Mutual labels:  validation
Play2 Html5tags
HTML5 form tags module for Play Framework
Stars: ✭ 101 (-12.93%)
Mutual labels:  validation
Ymate Platform V2
YMP是一个非常简单、易用的轻量级Java应用开发框架,涵盖AOP、IoC、WebMVC、ORM、Validation、Plugin、Serv、Cache等特性,让开发工作像搭积木一样轻松!
Stars: ✭ 106 (-8.62%)
Mutual labels:  validation
Kubeconform
A FAST Kubernetes manifests validator, with support for Custom Resources!
Stars: ✭ 111 (-4.31%)
Mutual labels:  validation

Pycpfcnpj

Description

Python module for brazilian register numbers for persons (CPF) and companies (CNPJ). If want this validation in your web application, please check my tiny web component that does exactly that. ;)

Python 3 ready!

Build Status codecov PyPI version Python versions

Related projects

  • Pycnpj-crawler: Python module that crawls data for a given CNPJ on the government website of each state (please check the supported states).

How to install

Now you can install this module with pip! Yeah! :D

pip install pycpfcnpj

Quick Start

To use pycpfcnpj is simples like as every python module should be!

from pycpfcnpj import cpfcnpj
cpf_number = '11144477735'
masked_cpf_number = '111.444.777-35'
cnpj_number = '11444777000161'
masked_cnpj_number = '11.444.777/0001-61'

print cpfcnpj.validate(cpf_number)
print cpfcnpj.validate(masked_cpf_number)
print cpfcnpj.validate(cnpj_number)
print cpfcnpj.validate(masked_cnpj_number)

Expected output:
>>>True
>>>True
>>>True
>>>True

Simple like that. =)

You can use, as well, the cpf and cnpj packages. The cpfcnpj is like a Facade to the other modules. Make yourself confortable.

Oh, fork and contribute either if you want to.

Obs.: There is no dependencies.

Oh, and before I forget, You can generate, only and only for test purposes, a CPF or CNPJ number using the 'gen' module. Easy like above:

from pycpfcnpj import gen
gen.cpf()
gen.cnpj()

Expected output:
>>> 49384063495
>>> 20788274885880

And you also can generate CPF or CǸPJ with punctuation marks. :)

from pycpfcnpj import gen
gen.cpf_with_punctuation()
gen.cnpj_with_punctuation()

Expected output:
>>> 048.891.866-97
>>> 63.212.638/0361-35

Have fun!

In portuguese:

Módulo python para validar números de CPF e CNPJ.

Como instalar:

Agora você pode instalar o pycpfcnpj usando o pip!\m/

pip install pycpfcnpj

Projetos relacionados

Como usar

from pycpfcnpj import cpfcnpj
cpf_number = '11144477735'
masked_cpf_number = '111.444.777-35'
cnpj_number = '11444777000161'
masked_cnpj_number = '11.444.777/0001-61'

print cpfcnpj.validate(cpf_number)
print cpfcnpj.validate(cpf_number_mascara)
print cpfcnpj.validate(cnpj_number)
print cpfcnpj.validate(cnpj_number_mascara)

Expected output:
>>>True
>>>True
>>>True
>>>True

Simples assim! Você também pode usar os pacotes internos que tratam em separado os números de CPF e CNPJ. O módulo 'cpfcnpj' é um tipo de interface para os módulos mais especificos e se encarrega de saber quando você está passando um CPF ou um CNPJ.

Fique à vontade em contribuir com o projeto ou da maneira que quiser. Ah, sim: pure python (sem dependências ;) ).

Ah, e antes que eu me esqueça, você pode gerar, só e apenas somente para fins de teste, um número de CPF ou CNPJ utilizando o módulo 'gen'. Fácil como acima:

from pycpfcnpj import gen
gen.cpf()
gen.cnpj()

Expected output:
>>> 49384063495
>>> 20788274885880

E você também pode gerar CPF ou CNPJ com pontuação :)

from pycpfcnpj import gen
gen.cpf_with_punctuation()
gen.cnpj_with_punctuation()

Expected output:
>>> 048.891.866-97
>>> 63.212.638/0361-35

Divirta-se!

Changelog

1.6.0

  • Remove python 2.7 support
  • Add python 3.8 support

1.1

  • Handles CPF and CNPJ numbers with punctuation marks.

1.2

  • Use sys rather than six to check python's version and keeps this project 100% free of dependencies.

1.3

  • Generate CPF and CNPJ numbers with punctuation marks.

1.4

  • Adding support to unicode values.

1.5

  • Better CPF and CNPJ generation

1.5.1

  • Use regex to remove punctuation

Log de mudanças

1.6.0

  • Remove suporte para python 2.7
  • Adiciona suporte para python 3.8

1.1

  • Trata números de CPF e CPNJ com sinais de pontuação

1.2

  • Uso do sys em vez do six para verificar a versão do Python e evitando o uso de libs terceiras

1.3

  • Gera números de CPF e CNPJ com pontuação.

1.4

  • Suporte a unicode.

1.5

  • Geração de CPF e CNPJ mais eficiente.

1.5.1

  • Regex para remover a pontuação.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].