Skip to content

diogosilva30/NIF-validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyPI version

NIF-validator

A small Python package to validate Portuguese taxpayer numbers (NIFs). It checks if NIFs are in a correct format and if they do in fact exist.

Installation 📦

From PyPi repository:

pip install NIF-validator

From source code:

git clone https://github.com/spamz23/NIF-validator.git
virtualenv venv
pip install -r requirements.txt

How to use it?

It's very simple! 🔥

import nif_validator

# Let's try to validate "123456789"
nif_validator.validate("123456789")
>>> True
# Let's try to validate "123x56789" (notice the typo 'x')
nif_validator.validate("123x56789") 
>>> False
# Let's try to validate "123" (too small, must be 9 digits)
nif_validator.validate("123") 
>>> False

About

Small python package to validate Portuguese NIF's

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages