Post

CLI and Python API for running Talend Cloud jobs

Python package for Talend Cloud job execution and monitoring (talend-task)

I am using the Talend Cloud platform (now part of Qlik) for ETL pipelines and data workflows. I needed a way to remotely execute and monitor jobs from the command line, so I wrote talend-task (MIT licensed).

talend-task Python package:

About talend-task

The talend-task package provides a command-line interface and Python API client for executing and monitoring jobs in Talend Cloud, including ETL pipelines and other data workflows. It uses the Processing API to trigger executions and monitor their status.

The package consists of:

  • command-line interface (talend_task)
  • Python API client module (talend_task.talend_client) providing the TalendClient class

In this package, a “job” refers to a runnable Talend Task. Running a job creates a corresponding Talend Execution.

Installation

Install the package from PyPI:

1
pip install talend-task

CLI

talend_task is a CLI for running and monitoring jobs in Talend Cloud.

After installation, the talend_task command is available in your shell.

Select a job interactively or pass --job directly.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
$ talend_task --help
usage: talend_task [-h] [--debug] [--wait] [--activity] [--job NAME] [--timeout SECS]
                   [--poll-interval SECS]

Talend Cloud CLI

options:
  -h, --help            show this help message and exit
  --debug               enable debug logging
  --wait                wait for job to complete and return status
  --activity            show recent runs without executing job (cannot use --wait)
  --job NAME            job name
  --timeout SECS        timeout (requires --wait, default: none)
  --poll-interval SECS  polling interval (requires --wait, default: 5)

Example CLI Usage

Direct Mode:

Run a job by providing --job <name>:

1
talend_task --wait --job Job1

Interactive Mode:

Run the CLI without specifying a job to select and execute one from a menu:

1
talend_task --wait

Activity Mode:

Show recent runs for a job without executing it:

1
talend_task --activity --job Job1

CLI Screenshots

Interactive mode:

Screenshot

Direct mode:

Screenshot

Activity mode:

Screenshot


Python API Client

Use the TalendClient class to interact with Talend Cloud from Python.

See the API documentation for details.

Example Client Usage

1
2
3
4
5
6
7
8
from talend_task import TalendClient

api_url = "https://api.us.cloud.talend.com"
access_token = "SECRET"

with TalendClient(api_url, access_token) as client:
    job_id = client.get_job_id("Job_123")
    status = client.run(job_id, wait=True)
This post is licensed under CC BY 4.0 by the author.