$npx skillfedfor your agent

sparkdantic

A pydantic -> spark schema library

With conditionsPyPI Application FrameworksReleased Jul 20261.4M downloads / moPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — sparkdantic-2.8.4-py3-none-any.whl
v2.8.4 · released 2026-07-13 · Python <4.0.0,>=3.10 · 5 runtime deps: jinja2, jmespath, packaging, pydantic, pyparsing

Yes, if you work with both Pydantic and PySpark. Low install friction, no security vulnerabilities, and active maintenance make it a safe choice. The optional PySpark dependency is a practical design—you can use JSON schema generation immediately. The main caveat is that license information is unavailable, so verify licensing for your use case before committing to production.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • PySpark 3.3.0 or higher (up to but not including 4.2.0) required for StructType schema generation; JSON schema generation works without PySpark.
  • Low install friction with a pure-Python wheel.
  • PySpark is optional; JSON schema generation works without it, but StructType conversion requires PySpark 3.3.0 or higher (up to but not including 4.2.0).

License · maintenance · safety

(unclear)

last release 2026-07-13 (32 days)

0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,408,664 downloads/mo, #3,942 on PyPI

Verify before relying

pip install sparkdantic

from sparkdantic import SparkModel
from typing import List

class MyModel(SparkModel):
    name: str
    age: int
    hobbies: List[str]

spark_schema = MyModel.model_spark_schema()
  • Whether the package is actively maintained beyond the 32-day release window (no repo stars, commit history, or archived status data available).
  • Real-world performance and compatibility with edge cases in complex Pydantic type hierarchies.
Same gist for agents: .md · .json

What it is and what it does

SparkDantic bridges Pydantic and PySpark by letting you define data models once as Pydantic classes and automatically generate PySpark schemas from them. It extends Pydantic's BaseModel with a SparkModel class that adds schema generation methods, and also provides standalone functions to convert existing Pydantic models. The package handles type mapping from Python/Pydantic types to Spark native types, supports Enums (mixed with int or str), and allows field-level type coercion via a SparkField function. PySpark is optional—you can generate JSON-formatted Spark schemas without it, but StructType generation requires PySpark 3.3.0 or higher (up to but not including 4.2.0).

The package depends on jinja2, jmespath, packaging, pydantic, and pyparsing. It's designed for workflows where you need to validate data with Pydantic and then load or process it in Spark, eliminating the need to maintain separate schema definitions. Fields can be excluded from Spark schemas using Pydantic's built-in exclude mechanism, useful for Spark-incompatible types.

Use it for

  • Define a Pydantic model for data validation, then generate a PySpark StructType schema for DataFrame operations without manual schema definition.
  • Convert existing Pydantic BaseModel classes to Spark schemas using the standalone create_spark_schema function for legacy codebases.
  • Generate JSON-formatted Spark schemas from Pydantic models for serialization or schema registry integration without requiring PySpark installed.
  • Enforce type safety across validation and Spark processing by coercing Pydantic fields to specific Spark types via SparkField.
  • Exclude Spark-incompatible fields (e.g., arbitrary objects) from schema generation while keeping them in the Pydantic model for validation.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you work with both Pydantic and PySpark.

Low install friction, no security vulnerabilities, and active maintenance make it a safe choice. The optional PySpark dependency is a practical design—you can use JSON schema generation immediately. The main caveat is that license information is unavailable, so verify licensing for your use case before committing to production.

Install

sparkdantic on PyPI

Before you install

Low install friction with a pure-Python wheel. PySpark is optional; JSON schema generation works without it, but StructType conversion requires PySpark 3.3.0 or higher (up to but not including 4.2.0). Actively maintained as of 32 days ago.

PySpark 3.3.0 or higher (up to but not including 4.2.0) required for StructType schema generation; JSON schema generation works without PySpark.

Quickstart

pip install sparkdantic

from sparkdantic import SparkModel
from typing import List

class MyModel(SparkModel):
    name: str
    age: int
    hobbies: List[str]

spark_schema = MyModel.model_spark_schema()

Verify before relying

  • Whether the package is actively maintained beyond the 32-day release window (no repo stars, commit history, or archived status data available).
  • Real-world performance and compatibility with edge cases in complex Pydantic type hierarchies.

Package facts

LicenseNot declared unclear
Python supportSupports the current Python release <4.0.0,>=3.10
Install frictionLow. Pure-Python wheel
Runtime dependencies
5 packages
jinja2jmespathpackagingpydanticpyparsing
MaintenanceActively maintained 32 days since the last release
First released
Downloads1,408,664 / month, #3,942 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14

Evidence: sparkdantic-2.8.4-py3-none-any.whl

Tags

Capabilities
pydantic to spark schema conversionpydantic sparkdanticspark structtype from pydanticpydantic model spark schemaconvert pydantic to pysparkpydantic spark integration
Topics
pydantic-integrationspark-schema-generationdata-validation

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “pydantic sparkdantic”

  • sparkdanticConverts Pydantic models to PySpark schemas (StructType or JSON…
  • pydantic-extra-typesProvides additional type validators and serializers for Pydantic v2…
  • pydantic-compatProvides compatibility mixins and adapters to use either pydantic v1…

Give your agent the search over MCP, or paste the wish link into any chat.

More Application Frameworks packages

fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.

MITpure Python · 3.9+
456.2Mdownloads / mo
textual Worth it
PyPI · Application Frameworks · released Jun 2026

Textual is a Python framework for building cross-platform user interfaces that run in the terminal or web browser using a modern, component-based API.

Install it if you're developing CLI tools, dashboards, or interactive terminal applications.

MITpure Python
443.6Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.

Install it if you are building CLIs in Python.

MITpure Python · 3.10+
369.3Mdownloads / mo
mcp Worth it
PyPI · Application Frameworks · released Jul 2026

Build and connect to Model Context Protocol servers that expose tools, resources, and prompts to LLM applications over stdio, HTTP, or SSE transports.

Install it if you need to build or connect to servers.

MITpure Python · 3.10+
319.3Mdownloads / mo
Werkzeug Worth it
PyPI · Application Frameworks · released Apr 2026

Werkzeug is a WSGI utility library providing request/response objects, URL routing, an interactive debugger, HTTP utilities, and a development server for building web applications.

BSD-3-Clausepure Python · 3.9+
268.1Mdownloads / mo

See also sparkaid · tinsel · pbspark · pydantic-to-typescript · pydantic-spark · graphene-pydantic · pydantic-to-typescript2 · dydantic · pyspark-data-sources · quinn