dni

Welcome to the docs for version 0.2.0.

dni is a small python package to make your life easier with Spanish Ids. Currently, it supports the DNI specification. NIE and Spanish passports are not supported at the moment.

Features include:

  • Check validity of DNIs.

  • Get check letter for a DNI number.

  • Avoid primitive obsession with the DNI class. Get the components of the DNI, format it in different ways, check for equality.

  • Find and extract multiple DNIs from text.

  • Get detailed exceptions when a string has issues.

  • Generate random, valid DNIs.

Indices and tables