Skip to main content

A small Python package to validate Portuguese taxpayer numbers (NIFs)

Project description

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 :package:

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! :fire:

import NIF_validator

# Let's try validating "123456789"
NIF_validator.validate("123456789") # Returns True

# Let's try validating "123x56789" (notice the typo 'x')
NIF_validator.validate("123x56789") # Returns False

# Let's try validating "123" (too small, must be 9 digits)
NIF_validator.validate("123") # Returns False

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

NIF-validator-0.0.6.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

NIF_validator-0.0.6-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file NIF-validator-0.0.6.tar.gz.

File metadata

  • Download URL: NIF-validator-0.0.6.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for NIF-validator-0.0.6.tar.gz
Algorithm Hash digest
SHA256 e549fc4edfd6f7bc10712be0e833123db4fd61efe0e86b154145c22e2f540107
MD5 6d0592ccaabf31bf0f81881eea1efa51
BLAKE2b-256 588d94a0ef9b66797ed00d11acfd7abe06fa5a3bf2235b220273dad8d779d2ab

See more details on using hashes here.

File details

Details for the file NIF_validator-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: NIF_validator-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.9.0

File hashes

Hashes for NIF_validator-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 770469aeedf946f0c238e4302a72d847885b1fb5366b3be9e196f8f8823e22e4
MD5 5bb4895fc5d59c33eb68ab5d7d636ff5
BLAKE2b-256 e17e3007a6790f26674b53073aed23eb2d315dcb2ed996a919192808e60bb744

See more details on using hashes here.

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