quienesquien
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
Token Generation
Before performing searches, you need to create an authentication token using the create_token method:
from quienesquien import Client
auth_token = await Client.create_token(os.environ['QEQ_CLIENT_ID'], os.environ['QEQ_SECRET_ID'])
You can reuse this token in subsequent requests.
Example
Once you have the token, you can perform searches by passing it:
import os
from quienesquien import Client
from quienesquien.enums import Gender, SearchList, SearchType
from quienesquien.exc import (
InsufficientBalanceError,
InvalidPlanError,
InvalidTokenError,
PersonNotFoundError,
)
auth_token = await Client.create_token(os.environ['QEQ_CLIENT_ID'], os.environ['QEQ_SECRET_ID'])
client = Client(
os.environ['QEQ_USER'],
auth_token,
)
try:
persons = await client.search(
full_name='Andres Manuel Lopez 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 = []
Environment Variable (Optional)
To simplify usage, you can store the token in an environment variable:
export QEQ_AUTH_TOKEN=your_auth_token
Then, instantiate the client using the environment variable:
import os
client = Client(
os.environ['QEQ_USER'],
os.environ['QEQ_CLIENT_ID'],
os.environ.get('QEQ_AUTH_TOKEN'),
)
Search Parameters
full_name(str): Full name of the person.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.include_history(bool | None): IfTrue, include historical records; ifFalse, only current; ifNone, use API default.
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: full_name, rfc or curp.
Response Structure
persons(list): List of matched persons.
Metadata
Release files for quienesquien 1.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| quienesquien-1.0.4.tar.gz | 9.5 kB | Without provenance | Details for quienesquien-1.0.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| quienesquien-1.0.4-py3-none-any.whl | Python 3 | none | any | Details for quienesquien-1.0.4-py3-none-any.whl |
Total release size: 21.0 kB
Release files / quienesquien-1.0.4.tar.gz
| Download URL | quienesquien-1.0.4.tar.gz |
|---|---|
| Size | 9.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ab41d74a6efa55b17a318d369d5598b7274239e1fd2d37f8ef8a874705f1c58d
|
|
BLAKE2b-256 checksum How to use checksums |
bce441a1285165daa4c83945633862e2f5f60168d0d32b3b1c94e2ac1898580f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / quienesquien-1.0.4-py3-none-any.whl
| Download URL | quienesquien-1.0.4-py3-none-any.whl |
|---|---|
| Size | 11.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7317d0d5093d2252c36953bc6ec0469b7e3ad4f2400f1e58014fea14b6890bb8
|
|
BLAKE2b-256 checksum How to use checksums |
b12811c38a226efcb876d7b06f16118125952291cbe0fa64f174eda8557ff257
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Security for quienesquien 1.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.