Git Product home page Git Product logo

pycpfcnpj's Introduction

Pycpfcnpj

Description

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

Python 3 ready!

Build Status codecov PyPI version

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 shoud be!

from pycpfcnpj import cpfcnpj
cpf_number = '11144477735'
cnpj_number = '11444777000161'
print cpfcnpj.validate(cpf_number)
print cpfcnpj.validate(cnpj_number)

Expected output:
>>>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

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

Como usar

from pycpfcnpj import cpfcnpj
cpf_number = '11144477735'
cnpj_number = '11444777000161'
print cpfcnpj.validate(cpf_number)
print cpfcnpj.validate(cnpj_number)

Expected output:
>>>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

Divirta-se!

pycpfcnpj's People

Contributors

matheuscas avatar paulohrpinheiro avatar rodfersou avatar asagalo avatar

Watchers

Bruno avatar Daniel Silvestre avatar Glauco Elias Margarido avatar James Cloos avatar  avatar Vitor  Kusiaki avatar Tales Galvão avatar  avatar Rubens Takauti avatar Pablo Silva avatar Lucas Henrique M Dourado avatar Augusto Hubert avatar Lyon César avatar Henrique Gasques avatar Rebelatto avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.