Collection of Apache Spark Custom Data Formats
Project description
PySpark Data Source Formats
This project provides a collection of custom data source formats for Apache Spark 4.0+ and Databricks, leveraging the new V2 data source PySpark API.
Formats
Currently, the following formats are supported:
| Format | Read | Write | Description |
|---|---|---|---|
http-csv |
Yes | No | Reads CSV files in parallel directly from a URL. |
http-json |
Yes | No | Reads JSON Lines in parallel directly from a URL. |
http-page |
Yes | No | Parses HTML page, extracts links, fetches headers. |
📖 Full Documentation — detailed options, examples, and API reference.
Installation
# Install PySpark 4.0.0
pip install pyspark==4.0.0
# Install the package using pip
pip install pysparkformat
For Databricks, install within a Databricks notebook using:
%pip install pysparkformat
This has been tested with Databricks Runtime 15.4 LTS and later.
Quick Start
http-csv
from pyspark.sql import SparkSession
from pysparkformat.http.csv import HTTPCSVDataSource
spark = SparkSession.builder.appName("example").getOrCreate()
spark.dataSource.register(HTTPCSVDataSource)
url = "https://example.com/data.csv"
df = spark.read.format("http-csv").option("header", True).load(url)
df.show()
http-json
from pysparkformat.http.json import HTTPJSONDataSource
spark.dataSource.register(HTTPJSONDataSource)
url = "https://example.com/data.jsonl"
df = spark.read.format("http-json").schema("name string, value int").load(url)
df.show()
http-page
from pysparkformat.http.page import HTTPPageDataSource
spark.dataSource.register(HTTPPageDataSource)
# Parse page for all links and get headers via HEAD requests
df = spark.read.format("http-page").load("https://example.com/")
df.show() # columns: page_request_url, page_request_datetime, page_request_error, page_response_http_status, page_response_headers, page_backlink_url
Contribute
Contributions are welcome! We encourage the addition of new custom data source formats and improvements to existing ones.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pysparkformat-0.0.13.tar.gz.
File metadata
- Download URL: pysparkformat-0.0.13.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8b1d2c8ec0a01b3f74dd64604705d3607a993bfafe09769968112aa57518282e
|
|
| MD5 |
ec5085336ca993a3a81d9bbacc5e9abf
|
|
| BLAKE2b-256 |
7a0e835f2ae58e9dc32019d133b0dba8d8acac53d1055af47210950020f3c784
|
Provenance
The following attestation bundles were made for pysparkformat-0.0.13.tar.gz:
Publisher:
release.yaml on aig/pysparkformat
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pysparkformat-0.0.13.tar.gz -
Subject digest:
8b1d2c8ec0a01b3f74dd64604705d3607a993bfafe09769968112aa57518282e - Sigstore transparency entry: 774242203
- Sigstore integration time:
-
Permalink:
aig/pysparkformat@175b88e2de67eab69675dd671b04b8a19855482b -
Branch / Tag:
refs/tags/release/v0.0.13 - Owner: https://github.com/aig
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@175b88e2de67eab69675dd671b04b8a19855482b -
Trigger Event:
push
-
Statement type:
File details
Details for the file pysparkformat-0.0.13-py3-none-any.whl.
File metadata
- Download URL: pysparkformat-0.0.13-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ba9870d661418373dec95851ee917d328f9ac5e103cabbb26f4f89a00c148d3
|
|
| MD5 |
bb6a7931ebff3c5efc8c5d10f9e5efed
|
|
| BLAKE2b-256 |
10f8071b627510ee64fe13a6d6c811bef8f53b483bb438f61ab235300453d374
|
Provenance
The following attestation bundles were made for pysparkformat-0.0.13-py3-none-any.whl:
Publisher:
release.yaml on aig/pysparkformat
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pysparkformat-0.0.13-py3-none-any.whl -
Subject digest:
9ba9870d661418373dec95851ee917d328f9ac5e103cabbb26f4f89a00c148d3 - Sigstore transparency entry: 774242206
- Sigstore integration time:
-
Permalink:
aig/pysparkformat@175b88e2de67eab69675dd671b04b8a19855482b -
Branch / Tag:
refs/tags/release/v0.0.13 - Owner: https://github.com/aig
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@175b88e2de67eab69675dd671b04b8a19855482b -
Trigger Event:
push
-
Statement type: