> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wherobots.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SedonaContext

> Create a Spark session with the WherobotsDB spatial functions and types registered.

```python theme={"system"}
from sedona.spark import SedonaContext
```

## SedonaContext

```python theme={"system"}
SedonaContext()
```

### builder()

```python theme={"system"}
SedonaContext.builder() -> SparkSession.builder
```

This method adds the basic Sedona configuration to the SparkSession builder.
Usually the user does not need to call this method directly, as it is configured when a cluster is created.
This method is needed when the user wants to manually configure Sedona
:return: SparkSession.builder

### create()

```python theme={"system"}
SedonaContext.create(spark: SparkSession) -> SparkSession
```

This is the core of whole package, It uses py4j to run wrapper which takes existing SparkSession
and register the core logics of Apache Sedona, for this SparkSession.

#### Parameters

<ParamField path="spark" type="SparkSession" required>
  pyspark.sql.SparkSession, spark session instance
</ParamField>

#### Returns

<ResponseField name="return" type="SparkSession">
  SedonaContext which is an instance of SparkSession
</ResponseField>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.