# pysparky_config

*module*

Standard-library helpers for composing Spark configuration mappings.

[View source](https://github.com/PySparky/pysparky-config/blob/af4b54281ec8606184de09177ebf2ae4c49d57f0/src/pysparky_config/__init__.py#L1-L1)

## pysparky_config.AwsS3SparkConfig

*class* · *dataclass*

```python
class AwsS3SparkConfig
```

Re-exported from: `pysparky_config.presets`

Object-oriented wrapper around `aws_s3_spark_config`.

[View source](https://github.com/PySparky/pysparky-config/blob/af4b54281ec8606184de09177ebf2ae4c49d57f0/src/pysparky_config/presets.py#L306-L313)

### pysparky_config.AwsS3SparkConfig.hadoop_version

*attribute* · *instance attribute*

```python
hadoop_version: str
```

[View source](https://github.com/PySparky/pysparky-config/blob/af4b54281ec8606184de09177ebf2ae4c49d57f0/src/pysparky_config/presets.py#L310-L310)

### pysparky_config.AwsS3SparkConfig.to_spark_config_map

*method*

```python
def to_spark_config_map() -> dict[str, str]
```

[View source](https://github.com/PySparky/pysparky-config/blob/af4b54281ec8606184de09177ebf2ae4c49d57f0/src/pysparky_config/presets.py#L312-L313)

## pysparky_config.AwsS3TablesSparkConfig

*class* · *dataclass*

```python
class AwsS3TablesSparkConfig
```

Re-exported from: `pysparky_config.presets`

Object-oriented wrapper for the S3 Tables Iceberg REST preset.

[View source](https://github.com/PySparky/pysparky-config/blob/af4b54281ec8606184de09177ebf2ae4c49d57f0/src/pysparky_config/presets.py#L316-L335)

### pysparky_config.AwsS3TablesSparkConfig.catalog_name

*attribute* · *instance attribute*

```python
catalog_name: str
```

[View source](https://github.com/PySparky/pysparky-config/blob/af4b54281ec8606184de09177ebf2ae4c49d57f0/src/pysparky_config/presets.py#L323-L323)

### pysparky_config.AwsS3TablesSparkConfig.iceberg_version

*attribute* · *instance attribute*

```python
iceberg_version: str
```

[View source](https://github.com/PySparky/pysparky-config/blob/af4b54281ec8606184de09177ebf2ae4c49d57f0/src/pysparky_config/presets.py#L322-L322)

### pysparky_config.AwsS3TablesSparkConfig.region

*attribute* · *instance attribute*

```python
region: str
```

[View source](https://github.com/PySparky/pysparky-config/blob/af4b54281ec8606184de09177ebf2ae4c49d57f0/src/pysparky_config/presets.py#L324-L324)

### pysparky_config.AwsS3TablesSparkConfig.scala_binary_version

*attribute* · *instance attribute*

```python
scala_binary_version: str
```

[View source](https://github.com/PySparky/pysparky-config/blob/af4b54281ec8606184de09177ebf2ae4c49d57f0/src/pysparky_config/presets.py#L321-L321)

### pysparky_config.AwsS3TablesSparkConfig.spark_version

*attribute* · *instance attribute*

```python
spark_version: str
```

[View source](https://github.com/PySparky/pysparky-config/blob/af4b54281ec8606184de09177ebf2ae4c49d57f0/src/pysparky_config/presets.py#L320-L320)

### pysparky_config.AwsS3TablesSparkConfig.table_bucket_arn

*attribute* · *instance attribute*

```python
table_bucket_arn: str
```

[View source](https://github.com/PySparky/pysparky-config/blob/af4b54281ec8606184de09177ebf2ae4c49d57f0/src/pysparky_config/presets.py#L325-L325)

### pysparky_config.AwsS3TablesSparkConfig.to_spark_config_map

*method*

```python
def to_spark_config_map() -> dict[str, str]
```

[View source](https://github.com/PySparky/pysparky-config/blob/af4b54281ec8606184de09177ebf2ae4c49d57f0/src/pysparky_config/presets.py#L327-L335)

## pysparky_config.aws_glue_rest_spark_config

*function*

```python
def aws_glue_rest_spark_config(spark_version: str, scala_binary_version: str, iceberg_version: str, catalog_name: str, region: str, aws_account_id: str) -> dict[str, str]
```

Re-exported from: `pysparky_config.presets`

Build a Spark map for the AWS Glue Iceberg REST endpoint.

``aws_account_id`` is emitted as Iceberg's REST warehouse identifier. The
function neither reads nor creates AWS credentials.

[View source](https://github.com/PySparky/pysparky-config/blob/af4b54281ec8606184de09177ebf2ae4c49d57f0/src/pysparky_config/presets.py#L204-L234)

## pysparky_config.aws_glue_spark_config

*function*

```python
def aws_glue_spark_config(spark_version: str, scala_binary_version: str, iceberg_version: str, catalog_name: str, warehouse: str) -> dict[str, str]
```

Re-exported from: `pysparky_config.presets`

Build an Iceberg Glue catalog map using the Iceberg AWS dependency bundle.

AWS SDK libraries are supplied transitively by the version-matched
``iceberg-aws-bundle`` coordinate; this factory does not add a second SDK
version. Authentication and region selection remain with the caller's AWS
runtime configuration.

[View source](https://github.com/PySparky/pysparky-config/blob/af4b54281ec8606184de09177ebf2ae4c49d57f0/src/pysparky_config/presets.py#L174-L201)

## pysparky_config.aws_s3_spark_config

*function*

```python
def aws_s3_spark_config(hadoop_version: str) -> dict[str, str]
```

Re-exported from: `pysparky_config.presets`

Build a Hadoop S3A config map for a caller-selected Hadoop release.

Match ``hadoop_version`` to the Hadoop libraries supplied by the Spark
distribution. Credentials are intentionally outside this preset.

[View source](https://github.com/PySparky/pysparky-config/blob/af4b54281ec8606184de09177ebf2ae4c49d57f0/src/pysparky_config/presets.py#L237-L247)

## pysparky_config.aws_s3_tables_spark_config

*function*

```python
def aws_s3_tables_spark_config(spark_version: str, scala_binary_version: str, iceberg_version: str, catalog_name: str, region: str, table_bucket_arn: str) -> dict[str, str]
```

Re-exported from: `pysparky_config.presets`

Build an Iceberg REST configuration map for an S3 Tables bucket.

The Iceberg AWS bundle supplies the matching AWS SDK dependency set. The
caller supplies a table-bucket ARN and the region; no network or IAM access
occurs while constructing the map.

[View source](https://github.com/PySparky/pysparky-config/blob/af4b54281ec8606184de09177ebf2ae4c49d57f0/src/pysparky_config/presets.py#L250-L283)

## pysparky_config.compose_spark_configs

*function*

```python
def compose_spark_configs(*configs: Mapping[str, str], overrides: Mapping[str, str] | None = None) -> dict[str, str]
```

Re-exported from: `pysparky_config.composition`

Compose Spark config maps with explicit scalar conflict handling.

Equal scalar values are kept once. Different scalar values raise ``ValueError``
unless the key appears in ``overrides``. ``spark.jars.packages`` and
``spark.sql.extensions`` are merged as comma-separated lists in first-seen
order, with exact duplicate entries removed. Package coordinates that name the
same group and artifact at different versions raise ``ValueError``.

The input mappings are not modified. Keys keep their first-seen order; an
explicit override changes a value without moving its key. The function uses
only the standard library and does not validate runtime compatibility or
initialize Spark.

**Raises**

- `TypeError` — If an input or override is not a string-to-string mapping.
- `ValueError` — If a scalar conflict is unresolved, a list entry is malformed,
a package coordinate is incompatible, or an override targets a list
setting or unknown key.

[View source](https://github.com/PySparky/pysparky-config/blob/af4b54281ec8606184de09177ebf2ae4c49d57f0/src/pysparky_config/composition.py#L50-L123)

## pysparky_config.iceberg_spark_config

*function*

```python
def iceberg_spark_config(spark_version: str, scala_binary_version: str, iceberg_version: str, catalog_name: str, catalog_type: Literal['hadoop', 'hive', 'rest'], warehouse: str, catalog_uri: str | None = None) -> dict[str, str]
```

Re-exported from: `pysparky_config.presets`

Build an Iceberg Hadoop, Hive, or REST catalog configuration map.

``spark_version`` is the Spark major/minor line used in Iceberg's runtime
artifact name. This function does not verify that the selected Iceberg
release exists or supports the host's complete runtime tuple.

[View source](https://github.com/PySparky/pysparky-config/blob/af4b54281ec8606184de09177ebf2ae4c49d57f0/src/pysparky_config/presets.py#L145-L171)

## pysparky_config.mongodb_spark_config

*function*

```python
def mongodb_spark_config(spark_version: str, scala_binary_version: str, connector_version: str) -> dict[str, str]
```

Re-exported from: `pysparky_config.presets`

Build a MongoDB Spark Connector dependency map without connection data.

Connector release compatibility must be checked against MongoDB's current
Spark/Scala compatibility table. Connection URIs and credentials are not
accepted or emitted by this factory.

[View source](https://github.com/PySparky/pysparky-config/blob/af4b54281ec8606184de09177ebf2ae4c49d57f0/src/pysparky_config/presets.py#L286-L303)

**Modules**

- `pysparky_config.composition`
- `pysparky_config.presets`
