> ## 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.

# WherobotsDB Python API

> Python packages for WherobotsDB: sedona.spark, wherobots.vtiles, wherobots.matcher, and wherobots_gl.

Wherobots notebooks and job runs come with the WherobotsDB Python packages installed, so you don't need to install anything. Most notebooks import `sedona.spark` and create a Sedona context first:

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

config = SedonaContext.builder().getOrCreate()
sedona = SedonaContext.create(config)
```

`from sedona.spark import *` brings in `SedonaContext`, every DataFrame spatial function such as `ST_Contains`, the spatial statistics functions, and the geometry and raster column types. You can also import each name from the module shown on its reference page.

## Packages and modules

| Module | Reference | Contents |
| - | - | - |
| `sedona.spark` | [SedonaContext](/reference/wherobots-db/python/sedona-context) | Create a Spark session with the spatial functions and types registered. |
| `sedona.spark.sql.st_constructors` | [DataFrame constructors](/reference/wherobots-db/python/st-constructors/ST_Point) | Build geometry columns from coordinates, text, and binary formats, such as `ST_Point` and `ST_GeomFromWKT`. |
| `sedona.spark.sql.st_functions` | [DataFrame functions](/reference/wherobots-db/python/st-functions/ST_Buffer) | Measure, edit, transform, and index geometry columns, such as `ST_Buffer` and `ST_Area`. |
| `sedona.spark.sql.st_predicates` | [DataFrame predicates](/reference/wherobots-db/python/st-predicates/ST_Contains) | Test the spatial relationship between two columns, such as `ST_Contains` and `ST_Intersects`. |
| `sedona.spark.sql.st_aggregates` | [DataFrame aggregates](/reference/wherobots-db/python/st-aggregates/ST_Union_Agg) | Aggregate geometry columns, such as `ST_Union_Agg` and `ST_Envelope_Agg`. |
| `sedona.spark.stats` | [Spatial statistics](/reference/wherobots-db/python/stats) | DBSCAN clustering, local outlier factor, Getis-Ord hotspot detection, distance-band weights, spatially stratified sampling, and Moran's I. |
| `sedona.spark.geopandas` | [GeoPandas API](/reference/wherobots-db/python/geopandas/geodataframe) | `GeoDataFrame`, `GeoSeries`, and file readers that follow the GeoPandas API and run on Spark. |
| `sedona.spark.stac` | [STAC client](/reference/wherobots-db/python/stac) | Search STAC APIs and load items into Spark DataFrames. |
| `wherobots.vtiles` | [Vector tiles](/reference/wherobots-db/python/vtiles) | Generate vector tiles and PMTiles archives from Spark DataFrames. |
| `wherobots.matcher` | [Map matching](/reference/wherobots-db/python/matcher) | Match GPS points to road network edges. |
| `wherobots_gl` | [Map widget](/reference/wherobots-db/python/wherobots-gl) | Render the Wherobots map inline in a notebook. |

Each DataFrame function page links to the SQL function of the same name in the [WherobotsDB SQL reference](/reference/wherobots-db/geometry-data/overview), which describes its behavior in more detail.

Scala and Java code can call the spatial statistics, map matching, and vector tiles functions on these pages under camelCase names, for example `LocalOutlierFactor.localOutlierFactor` for `local_outlier_factor`.

<Note>
  Older import paths without `.spark`, such as `sedona.sql.st_functions` or `sedona.stats.clustering.dbscan`, still work but are deprecated. Use the `sedona.spark` paths on these pages.
</Note>


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