Skip to main content

Scraper para consultar el SIS

Project description

SIS Scraper 🏥

Librería Python para consultas con anti-detección y caché.

Características

  • Anti-detección: User-Agent rotation, headers spoofing, delays aleatorios
  • Caché SQLite: Guarda resultados por 1 año (configurable)
  • OCR automático: Resuelve CAPTCHAs con ddddocr + OpenCV
  • Reintentos automáticos: Si falla el captcha, reintenta
# Instalación desde PyPI (Recomendado)
pip install sis-scraper

# Instalación local (Desarrollo)
pip install -e .

📦 Instalación

Opción 1: Desde GitHub (Recomendado)

pip install git+https://github.com/tu-usuario/sis-scraper.git

(Nota: Incluye automáticamente ddddocr parcheado para evitar errores).

Opción 2: Desarrollo Local

Uso Rápido

from sis_scraper import SisScraperAntiDeteccion

# Crear scraper
scraper = SisScraperAntiDeteccion()

# Consultar DNI (con reintentos automáticos)
resultado = scraper.consultar_con_reintentos("12345678")

if resultado["exito"]:
    print(f"Nombre: {resultado['datos_personales']['nombre']}")
    print(f"Estado: {resultado['datos_personales']['estado']}")

Uso como CLI

# Si instalaste el paquete
sis-scraper

# O directamente
python -m sis_scraper.scraper

Configuración

# Cambiar duración del caché (en horas)
scraper = SisScraperAntiDeteccion(cache_horas=720)  # 30 días

# Cambiar ubicación de la base de datos
scraper = SisScraperAntiDeteccion(db_path="/ruta/mi_cache.db")

Estructura del Resultado

{
  "exito": true,
  "mensaje": "Consulta exitosa",
  "datos_personales": {
    "nombre": "APELLIDO APELLIDO NOMBRE",
    "documento": "DNI 12345678",
    "afiliacion": "2-12345678",
    "tipo_asegurado": "TITULAR",
    "estado": "ACTIVO"
  },
  "afiliaciones": [...]
}

Dependencias

  • requests
  • beautifulsoup4
  • ddddocr
  • opencv-python
  • Pillow
  • lxml
  • fake-useragent (opcional)

Licencia

MIT

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

sis_scraper-1.0.6.tar.gz (76.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sis_scraper-1.0.6-py3-none-any.whl (76.2 MB view details)

Uploaded Python 3

File details

Details for the file sis_scraper-1.0.6.tar.gz.

File metadata

  • Download URL: sis_scraper-1.0.6.tar.gz
  • Upload date:
  • Size: 76.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for sis_scraper-1.0.6.tar.gz
Algorithm Hash digest
SHA256 7590ef1f153d20af661aeecc06595fb158fdfd57817e31c1bf6aeaf8c9cf8e2f
MD5 1bea7c07c4ce453f1b63ddd8204a954b
BLAKE2b-256 e5b375bd5bc35a8cb6b346378dcf6188cf430eb2c6624c92626c66832dcbcaa9

See more details on using hashes here.

File details

Details for the file sis_scraper-1.0.6-py3-none-any.whl.

File metadata

  • Download URL: sis_scraper-1.0.6-py3-none-any.whl
  • Upload date:
  • Size: 76.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for sis_scraper-1.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a4af0ddb248109fd6ffffda9441dc54423a597c3eaa8990d77b3b1622f5a0ad4
MD5 89e137cd135cea3822d5202d6e85558b
BLAKE2b-256 d1cb074d72bf74ec4b25173e6ae9f5d09fab9c911f77b2980e61d92ed89bd336

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page