pyspark-data-sources
Custom Spark data sources for reading and writing data in Apache Spark, using the Python Data Source API
What it is and what it does
pyspark-data-sources is a library that wraps the Apache Spark Python Data Source API to simplify reading from and writing to external data systems. It provides pre-built connectors for common sources—including GitHub pull requests, Google Sheets, Kaggle datasets, stock market data, flight tracking, and synthetic data generation via faker—while also offering a framework for building your own custom data sources. The library depends on faker, mkdocstrings, pyarrow, and requests, and is designed for Spark 4.0 and later.
You use it by registering a data source with your Spark session, then reading or writing data using the standard Spark DataFrame API. For example, you can generate synthetic test data on the fly, fetch live flight information, or pull datasets from public APIs without writing low-level Spark connector code. It's intended both as a ready-to-use connector library and as a learning tool for building your own data sources.
Use it for:
- Generate synthetic test data on demand using faker for unit tests and local development.
- Read public datasets from Kaggle, Hugging Face, or GitHub directly into Spark DataFrames.
- Fetch live market data (stocks, crypto, weather) and ingest it into a Spark pipeline.
- Build a custom data source for an internal API or proprietary data system using the provided framework.
- Stream live flight tracking data or other real-time feeds into Spark Structured Streaming jobs.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides custom Apache Spark data sources using the Python Data Source API (Spark 4.0+), enabling you to read from and write to external systems directly as Spark DataFrames.
Yes, if you need to integrate external data sources into Spark 4.0+ pipelines and want to avoid writing custom connectors. The library has low install friction and no known vulnerabilities. However, the aging maintenance status (200 days since last release) means you should verify that the specific data sources you need are actively maintained and functional before committing to production use.
Install
pyspark-data-sources on PyPI
pip
pip install pyspark-data-sourcesuv
uv add pyspark-data-sourcespoetry
poetry add pyspark-data-sourcesInstalling pyspark-data-sources
Before you install
Low install friction with a pure-Python wheel. Maintenance status is aging—last release was 200 days ago—so expect slower response to issues, though no known vulnerabilities are present.
License in practice
Apache License 2.0 is permissive; you can use, modify, and distribute this package freely in commercial and private projects, provided you include the license notice and document any changes.
Quickstart
pip install pyspark-data-sources
from pyspark.sql import SparkSession
spark = SparkSession.builder.appName("demo").getOrCreate()
df = spark.read.format("fake").option("numRows", 5).load()
df.show()
Requires Apache Spark 4.0+ or Databricks Runtime 15.4 LTS+, and Python 3.9–3.12.
Verify before relying
- Whether all listed data sources (GitHub, Google Sheets, Kaggle, etc.) are fully functional or still in development.
- Performance characteristics when reading large datasets from external APIs.
- Whether optional dependencies (huggingface, kaggle, salesforce, lance, robinhood) are well-maintained and compatible.
Package facts
| License | Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) (permissive) |
| Python support | capped below the current Python release (<3.13,>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — faker, mkdocstrings, pyarrow, requests |
| Maintenance | aging — 200 days since the last release |
| First released | |
| Downloads | 78,772/month — #14,410 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pyspark_data_sources-0.1.11-py3-none-any.whl
Tags
More Distributed Computing packages
gRPC Python is an HTTP/2-based RPC framework…
permissive · top 100 on PyPI
execnetexecnet lets you spawn and communicate with…
permissive · top 1,000 on PyPI
cloudpickleCloudpickle extends Python's standard pickle…
permissive · top 1,000 on PyPI
smart-openProvides a unified, open()-compatible Python…
permissive · top 1,000 on PyPI
portalockerPortalocker provides cross-platform file…
permissive · top 1,000 on PyPI
rayRay is a distributed computing framework that…
permissive · top 1,000 on PyPI
pyspark-huggingfaceRegisters a Spark data source that reads…
permissive · top 5,000 on PyPI
pyspark-clientPython client for connecting to Apache Spark…
permissive · top 5,000 on PyPI
dbldatagenGenerates synthetic data at scale within…
unclear · top 15,000 on PyPI
pysparkPySpark provides Python bindings to Apache…
permissive · top 1,000 on PyPI
sparkmeasureSparkMeasure provides a Python API to collect…
permissive · top 5,000 on PyPI
hyperleaupGenerates Tableau Hyper files directly from…
permissive · top 15,000 on PyPI
sparkdanticConverts Pydantic models to PySpark schemas…
unclear · top 5,000 on PyPI
pyspark-testProvides a testing utility to assert equality…
permissive · top 15,000 on PyPI
databricks-sql-connectorA Python client library that connects to…
permissive · top 1,000 on PyPI
databricks-testProvides a unit testing framework for…
permissive · top 15,000 on PyPI