spark-python-data-source

Build custom PySpark DataSource implementations for Apache Spark external systems.

31|18|Updated Apr 4, 2026
One-click install
npx skills add https://github.com/ThomazRossito/data-agents --skill spark-python-data-source-thomazrossito
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spark-python-data-source
Source: https://github.com/ThomazRossito/data-agents/tree/main/skills/databricks/spark-python-data-source
Command: npx skills add https://github.com/ThomazRossito/data-agents --skill spark-python-data-source-thomazrossito

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Data engineers often need to read from or write to external systems that lack native Spark connectors, requiring custom development of PySpark DataSource implementations.

Core Features & Use Cases

  • Unified Architecture: Provides a flat, single‑level inheritance template for readers, writers, and streaming components.
  • Authentication & Partitioning: Includes patterns for multi‑method authentication and various partitioning strategies (time‑based, token‑range, ID‑range).
  • Resilience: Implements error handling, retries, circuit breakers, and dead‑letter queues.
  • Testing & Production: Supplies unit/integration testing guidelines, logging, observability, and security validation.
  • Use Cases: Build connectors for REST APIs, databases, message queues, or custom protocols in both batch and streaming modes.

Quick Start

Create a new Spark connector that reads data from a REST API into a DataFrame using the spark-python-data-source skill.

Frequently Asked Questions about spark-python-data-source

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a custom PySpark data source for an external API?

To build a custom PySpark data source for an external API, implement the PySpark DataSource API using a flat inheritance template for readers and writers. This provides option handling, partitioning, and type conversion.

When do I need a custom Spark data source?

You need a custom Spark data source when connecting to external systems lacking native Spark connectors, such as specific REST APIs, message queues, or databases requiring custom protocols for batch and streaming read/write tasks.

Does this approach support both batch and streaming workloads in Spark?

Yes, this approach supports both batch and streaming workloads in Spark. The unified architecture provides templates for streaming components alongside batch readers and writers to handle continuous data ingestion.

How do I handle authentication and partitioning in a Python Spark connector?

To handle authentication and partitioning in a Python Spark connector, apply built-in patterns for multi-method authentication and various strategies like time-based, token-range, or ID-range partitioning.

What is the best way to add error handling and retries to a PySpark data source?

The best way to add error handling and retries to a PySpark data source is to implement the provided resilience patterns, which include circuit breakers, retry logic, and dead-letter queues for failed operations.

Can I use this PySpark DataSource template with Databricks?

Yes, you can use this PySpark DataSource template with Databricks. It is designed to satisfy the PySpark DataSource API requirements and includes guidelines for logging, observability, and production security validation.