Find all polygons in an undirected graph

Is there a graphics library with a built-in function (any language, but prefers php, python, js) that locates all polygons in a given undirected graph?