apache/seatunnel

[Feature][Client] Python SDK Client for SeaTunnel REST API

クローズ

#10,125 opened on 2025/11/27

 (5 件のコメント) (0 件のリアクション) (1 人の担当者)Java (1,432 件のフォーク)batch import
good first issuehelp wanted

Repository metrics

Stars
 (6,897 個のスター)
PR merge metrics
 (平均マージ 13d 21h) (30d で 143 merged PRs)

説明

Motivation

SeaTunnel provides REST API v2 but lacks an official Python SDK. Users must manually construct HTTP requests, which is verbose and error-prone.

A Python SDK would:

  • Simplify integration with Python-based data pipelines
  • Provide type-safe interfaces and proper error handling
  • Improve developer experience in the Python ecosystem

Use Cases

  • Job management automation
  • System monitoring dashboards
  • CI/CD integration
  • Data pipeline orchestration (Airflow, Prefect)

Proposed Solution

Create seatunnel-python-sdk that wraps REST API v2: https://seatunnel.apache.org/docs/2.3.12/seatunnel-engine/rest-api-v2

Key Requirements

  1. Configuration Format: Support HOCON format to maintain consistency with .conf files
  2. API Coverage: Wrap all REST API v2 endpoints (system, jobs, logs)

Example Usage

from seatunnel import SeaTunnelClient

client = SeaTunnelClient(base_url="http://localhost:5801")

# Use HOCON format (same as .conf files)
job_config = """
env {
  job.mode = "BATCH"
  execution.parallelism = 4
}

source {
  Jdbc {
    url = "jdbc:mysql://localhost:3306/db"
    driver = "com.mysql.cj.jdbc.Driver"
    query = "select * from orders"
  }
}

sink {
  Jdbc {
    url = "jdbc:postgresql://localhost:5432/warehouse"
    driver = "org.postgresql.Driver"
  }
}
"""

# Submit and monitor
result = client.jobs.submit(job_config)
status = client.jobs.get_status(result.job_id)

Implementation Suggestions

  • Consider using pyhocon for HOCON parsing
  • Publish to PyPI as seatunnel-python-sdk
  • Support Python 3.8+

Related Issues

Willingness to Contribute

  • I am willing to submit a PR to implement this feature
  • I am willing to help with documentation
  • I am willing to help with testing

コントリビューターガイド