API Technical Specification

This is the exhaustive technical specification for the WPipe v2.4.0-LTS engine. Designed for precision and reliability.

🛠️ Engineering Standard

All public APIs adhere to Semantic Versioning 2.0.0. Method signatures are type-hinted and documented following the Google Python Style Guide.

1. Core Orchestration

class wpipe.Pipeline

The primary synchronization engine. It coordinates step execution and context management.

Constructor: Pipeline(pipeline_name: str, verbose: bool = False, tracking_db: str = None, ...)

Key Methods: * .set_steps(steps: List): Registers the execution chain. * .run(initial_data: Dict) -> Dict: Triggers the orchestration. * .add_checkpoint(name: str, expression: str): Gated state persistence.

class wpipe.PipelineAsync

The high-concurrency variant of the engine. Fully compatible with asyncio.

Usage: .. code-block:: python

result = await pipe_async.run(data)

2. Logical Control Blocks

Ramificación lógica.

Condition

Condition(expression, branch_true, branch_false)

Bucles controlados.

For

For(iterations, validation_expression, steps)

Multi-executor block.

Parallel

Parallel(steps, max_workers, use_processes)

3. Decorators & Intelligence

@wpipe.step

The universal task decorator. Injects metadata and resiliency settings into pure functions.

Parameters: * name: Logical identifier for the Dashboard. * version: Version tag for CI/CD tracking. * retry_count: Number of automatic recovery attempts. * timeout: Execution deadline in seconds.

class wpipe.AutoRegister

Helper for large projects. Automatically discovers and registers all @step functions in a module.

4. Persistence (WSQLite)

The recommended high-level API for data persistence.

🗄️ Wsqlite (Context Wrapper)
with Wsqlite(db_name="data.db") as db:
    db.input = ...
    db.output = ...
⚙️ SQLite (Core Engine)

The low-level driver optimized with WAL mode and thread-safe connection pooling.

5. Industrial Observability

class wpipe.ResourceMonitor

Real-time system probe. Measures CPU load and RSS Memory without blocking the main event loop.

Methods: * .get_summary(): Returns peak and average metrics.

class wpipe.PipelineExporter

Data bridge for external analysis.

  • .export_pipeline_logs(format="json|csv")

  • .export_statistics()

6. Error Architecture

Exception

Context

TaskError

Generic failure in a step. Contains forensic metadata.

ProcessError

Orchestration-level failure.

ApiError

Failure communicating with the API/Dashboard.

Codes

Constants for standardized error reporting (500-505).

7. Technical Utilities

  • leer_yaml / escribir_yaml: Thread-safe YAML IO with environment variable support.

  • new_logger: Loguru configuration for industrial rotation and retention.

  • memory_limit: Linux-specific memory cgroup control.


Looking for the full Python Auto-Docs? Visit the User Guide or inspect the docstrings directly in the source code.