ST_NRings
Accessors
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:

