Skip to main content

Cliente para listas quienesquien

Project description

quienesquien

test codecov PyPI

Client for the Quienesquien list service (https://app.q-detect.com/)

Installation

pip install quienesquien

Development & Testing

The project configuration is managed through environment variables. Set them before running tests:

export $(<env.template)

To run unit tests, use pytest.

pytest

Usage

Before using the client, configure the required environment variables:

export QEQ_USER=your_user
export QEQ_CLIENT_ID=your_client_id
export QEQ_SECRET_ID=your_secret_key

Example

import os
from quienesquien import Client
from quienesquien.enums import Gender, SearchList, SearchType
from quienesquien.exc import (
    InsufficientBalanceError,
    InvalidPlanError,
    InvalidTokenError,
    PersonNotFoundError,
)

client = Client(
    os.environ['QEQ_USER'],
    os.environ['QEQ_CLIENT_ID'],
    os.environ['QEQ_SECRET_ID'],
)

try:
    persons = await client.search(
        nombre='Andres Manuel',
        paterno='Lopez',
        materno='Obrador',
        match_score=85,
        rfc='LOOA531113F15',
        curp='LOOA531113HTCPBN07',
        gender=Gender.masculino,
        birthday=dt.date(1953, 11, 13),
        search_type=SearchType.fisica,
        search_list=(SearchList.PPE, SearchList.ONU),
    )
except InsufficientBalanceError:
    print('Saldo insuficiente')
except InvalidPlanError:
    print('Plan inválido')
except InvalidTokenError:
    print('Token inválido')
except PersonNotFoundError:
    persons = []

Search Parameters

  • nombre (str): First name(s) of the person.
  • paterno (str): First surname.
  • materno (str): Second surname.
  • match_score (int): Minimum match percentage (default: 60).
  • rfc (str): Mexican RFC.
  • curp (str): Mexican CURP.
  • gender (Gender): masculino or femenino.
  • birthday (datetime.date): Date of birth.
  • search_type (SearchType): fisica or moral.
  • search_list (tuple[SearchList, ...]): Lists to search. If not provided, searches all.

The search follows a hierarchical approach: it first attempts to find a match using the RFC. If no match is found, it searches by CURP. Finally, if neither is found, it looks for a match by name. You must specify at least one search parameter: name (including first nombre, paterno and materno), RFC or CURP.

Response Structure

  • persons (list): List of matched persons.

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

quienesquien-1.0.0.dev4.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

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

quienesquien-1.0.0.dev4-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file quienesquien-1.0.0.dev4.tar.gz.

File metadata

  • Download URL: quienesquien-1.0.0.dev4.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for quienesquien-1.0.0.dev4.tar.gz
Algorithm Hash digest
SHA256 139c8738f8e7a4dd10d43f7d8d177465c94d859c85344d033dd073e9ef2b2f03
MD5 1c26fa1961dad302d3037670b20103d9
BLAKE2b-256 26cda1a2446c94c3c2f1932686cadc7006b09216bd65b438ae7ca110fa1a48d4

See more details on using hashes here.

File details

Details for the file quienesquien-1.0.0.dev4-py3-none-any.whl.

File metadata

File hashes

Hashes for quienesquien-1.0.0.dev4-py3-none-any.whl
Algorithm Hash digest
SHA256 0546cc933ae849f1a7b4db92ffa5051e4f152f6a72dbc21b09b9aacbd4783639
MD5 cd3f597e98b950d49dff90cf88d1f217
BLAKE2b-256 78667985d003e72271842ac37c88b11c46a029ec074fd8f499f14beb0d16195e

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