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

# ST_NRings (Python)

> Returns the total number of rings in a Polygon or MultiPolygon.

Returns the total number of rings in a Polygon or MultiPolygon. Compared to ST\_NumInteriorRings, ST\_NRings takes exterior rings into account as well.

SQL reference: [`ST_NRings`](/reference/wherobots-db/geometry-data/accessors/ST_NRings)

## Signature

```python theme={"system"}
from sedona.spark.sql.st_functions import ST_NRings

ST_NRings(geometry: ColumnOrName) -> Column
```

## Parameters

<ParamField path="geometry" type="ColumnOrName" required>
  Geometry column to calculate rings for
</ParamField>

## Returns

<ResponseField name="return" type="Column">
  Number of exterior rings + interior rings (if any) for the given Polygon or MultiPolygon
</ResponseField>


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