Skip to main content

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, CEDULA o PASAPORTE.
  • 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.

Release files for valida-doc-chile 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for valida-doc-chile 0.1.3
File Size Uploaded
valida_doc_chile-0.1.3.tar.gz 3.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for valida-doc-chile 0.1.3
File Interpreter ABI Platform
valida_doc_chile-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 8.5 kB

Release files / valida_doc_chile-0.1.3.tar.gz

Download URL valida_doc_chile-0.1.3.tar.gz
Size 3.8 kB
Tags Source
SHA-256 checksum
How to use checksums
5bfef7516a8f1360f81c493a6733b1edb4ab990c53a54111a5617a2f20e59227
BLAKE2b-256 checksum
How to use checksums
e6d9a0a4bf9f316dca3fe0759735e394db2d45865fd7ad7c835ba8d05fb61450
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / valida_doc_chile-0.1.3-py3-none-any.whl

Download URL valida_doc_chile-0.1.3-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e18a730f4fe62964575740ee79fed0cbfab412eba1832a88da26bacb5139e567
BLAKE2b-256 checksum
How to use checksums
92072e1f4e169e3a541e6b8e3592af854615a5d0b3f305dd3d4f9fd0f761d76b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page