Metadata-Version: 2.4
Name: niftools
Version: 0.1.0
Summary: Validador mínimo y sin dependencias de DNI, NIE y NIF de entidades
Author: Pablo Castelo
License: MIT License
        
        Copyright (c) 2026 Pablo Castelo
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/pcastelovigo/validarnif
Project-URL: Repository, https://github.com/pcastelovigo/validarnif
Project-URL: Issues, https://github.com/pcastelovigo/validarnif/issues
Keywords: nif,nie,cif,dni,spain,validation
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# niftools

Validador mínimo y sin dependencias de identificadores fiscales españoles.
Comprueba DNI, NIE y NIF de entidades (tradicionalmente llamado CIF) mediante
su formato y carácter de control.

## Instalación

```bash
pip install niftools
```

## Uso

```python
from niftools import normalizarnif, validarnif

nif = normalizarnif("ES A-1234567-4")  # "A12345674"
validarnif(nif)                        # True

validarnif("12345678Z")             # True
validarnif("X-1234567-L")          # True
validarnif("12345678A")             # False
```

`normalizarnif()` elimina puntos, guiones, espacios y el prefijo internacional
opcional `ES`, y convierte el texto a mayúsculas. `validarnif()` reutiliza esa
normalización, por lo que acepta tanto identificadores normalizados como
identificadores con separadores.

La validación comprueba la estructura y el carácter de control. No confirma
que el identificador haya sido emitido ni que pertenezca a una persona o
entidad determinada.

El alcance incluye DNI, NIE y NIF de entidades (tradicionalmente CIF). No
incluye los NIF personales especiales que comienzan por `K`, `L` o `M` y
contienen un cuerpo alfanumérico.

## Compatibilidad

Python 3.8 o posterior.

## Pruebas

```bash
python -m unittest discover -v
```

## Licencia

MIT.
