Valida documentos de identidad de Chile
Project description
valida_doc_chile
Librería en Python para validar la vigencia de documentos de identidad chilenos (cédula y pasaporte) usando la API pública de regcivil.impish.top.
Instalación
pip install valida-doc-chile
Requisitos
- Python >= 3.2
Uso desde Python
from valida_doc_chile import query
estado = query("16273463-6", "106879378", "CEDULA")
print(estado) # "VALID", "NOT_VALID" o "NO_MATCH"
Parámetros
run: string, RUT con guión (ej. "16273463-6").doc_num: string, número de documento o número de serie.doc_type: string,CEDULAoPASAPORTE.api_key(opcional): string para usar la API con mayor frecuencia.
Retorno
La función query(...) retorna un string con uno de los siguientes valores:
VALID: el documento está vigente.NOT_VALID: el documento existe, pero no está vigente (vencido, bloqueado, perdido, etc.).NO_MATCH: no se encuentra coincidencia o el documento no existe.
Uso desde la línea de comandos
Al instalar el paquete, se agrega el comando valcl al entorno.
$ valcl --help
usage: Verificador de RUN [-h] run doc_num {CEDULA,PASAPORTE}
positional arguments:
run 16273463-6
doc_num 106879378
{CEDULA,PASAPORTE} Tipo de documento
options:
-h, --help show this help message and exit
$ valcl 16273463-6 106879378 CEDULA
El documento existe, pero no está vigente.
$ echo $?
1
Mensajes y códigos de salida
| respuesta API | mensaje impreso | exit code |
|---|---|---|
VALID |
El documento está vigente. | 0 |
NOT_VALID |
El documento existe, pero no está vigente. | 1 |
NO_MATCH |
No se encuentra coincidencia / el documento no existe. | 2 |
Más información
Esta librería usa la API gratuita de consulta de documentos proporcionada por regcivil.impish.top.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file valida_doc_chile-0.1.3.tar.gz.
File metadata
- Download URL: valida_doc_chile-0.1.3.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5bfef7516a8f1360f81c493a6733b1edb4ab990c53a54111a5617a2f20e59227
|
|
| MD5 |
6ade5557376055ed1bd0290679a634a3
|
|
| BLAKE2b-256 |
e6d9a0a4bf9f316dca3fe0759735e394db2d45865fd7ad7c835ba8d05fb61450
|
File details
Details for the file valida_doc_chile-0.1.3-py3-none-any.whl.
File metadata
- Download URL: valida_doc_chile-0.1.3-py3-none-any.whl
- Upload date:
- Size: 4.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e18a730f4fe62964575740ee79fed0cbfab412eba1832a88da26bacb5139e567
|
|
| MD5 |
82eeef2a4e5f4b1fd0a1eef97b6c0ef2
|
|
| BLAKE2b-256 |
92072e1f4e169e3a541e6b8e3592af854615a5d0b3f305dd3d4f9fd0f761d76b
|