InfiniAnalytics
InfiniAnalytics es una librería de Python que facilita el registro de eventos, inicios y finales de procesos, así como la notificación de errores, en la plataforma de Analítica de Infini.
El diseño está orientado a que nunca quiebre el flujo de tu automatismo o aplicación: ante cualquier error de comunicación o respuesta inesperada, la librería simplemente imprime un mensaje y devuelve None, pero no lanza excepciones no controladas.
Características principales
- Registro de inicio (
.start(description: str)) - Registro de evento (
.event(description: str)) - Registro de warning (
.warning(description: str)) - Registro de fin (
.end(description: str)) - Registro de errores (
.error(description: str, error_id: str = None, error_detailed: str = None)) - No lanza excepciones: Devuelve
Noneen caso de fallo e imprime el error por pantalla.
Cada vez que se crea una instancia de InfiniAnalytics, se genera (o se inyecta) un execution_id.
- Si no lo especificas, se genera automáticamente usando la hora actual (
datetime.now().isoformat()).
Instalación
La librería se puede instalar directamente desde PyPI con:
pip install infinianalytics
Uso básico
1. Importar e Instanciar
from infinianalytics import InfiniAnalytics
execution = InfiniAnalytics(
token="TU_TOKEN",
automation_id="44444444-4444-4444-4444-444444444444"
)
token (str): Cadena que te identifica para la autenticación.automation_id (str): Identificador único de tu automatización.execution_id (str)(opcional): Si lo omites, se genera uno automáticamente usando la fecha/hora actual.
2. Registrar eventos
Inicio (start)
execution.start("Starting the process")
Registra el inicio de la ejecución.
Evento intermedio (event)
execution.event("An event occurred")
Registra un evento relevante en el transcurso de la ejecución.
Warning (warning)
execution.warning("Warning: This is a non-critical issue")
Registra una advertencia durante la ejecución. Los warnings son útiles para notificar situaciones que no son errores críticos pero que requieren atención, como valores inesperados, configuraciones subóptimas, o condiciones que podrían llevar a problemas futuros.
Error (error)
Para registrar un error dentro de un try-except, por ejemplo:
try:
# Lógica que puede fallar
...
except Exception as ex:
execution.error(
description="Ocurrió un error durante el proceso",
error_id="1234",
error_description=str(ex)
)
Importante: Se recomienda siempre llamar al método .error(...) dentro de un bloque except, para asegurarte de capturar cualquier excepción y notificarla a la API.
La librería no lanza excepciones no controladas, por lo que tu automatismo no se detendrá.
Fin (end)
execution.end("Ending the process")
Registra el final de la ejecución.
Metadata
Release files for infinianalytics 0.1.9
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 |
|---|---|---|---|---|
| infinianalytics-0.1.9.tar.gz | 5.3 kB | Without provenance | Details for infinianalytics-0.1.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| infinianalytics-0.1.9-py3-none-any.whl | Python 3 | none | any | Details for infinianalytics-0.1.9-py3-none-any.whl |
Total release size: 10.2 kB
Release files / infinianalytics-0.1.9.tar.gz
| Download URL | infinianalytics-0.1.9.tar.gz |
|---|---|
| Size | 5.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1aeff28c1f009034d9030299506bc98e2f592e84b258cbad596df2651fc419f6
|
|
BLAKE2b-256 checksum How to use checksums |
bae0291c30ac8f5d1f718f6733ecb2925efedf8a2bfd8477aaa382857a76f080
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.9
|
Release files / infinianalytics-0.1.9-py3-none-any.whl
| Download URL | infinianalytics-0.1.9-py3-none-any.whl |
|---|---|
| Size | 5.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bae9f80dd823ac5410f3428b6b04ba43e7d130e461ec6a8c56c789ae43f451c8
|
|
BLAKE2b-256 checksum How to use checksums |
b814cbf08770edd00e71b29d328657ebaf352ad2f8ce1e37f670be6515c2564c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.9
|
Security for infinianalytics 0.1.9
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.