How to get and set face set values?

To get polygons, you can use bpy.types.Mesh.polygons.

import bpy
o = bpy.data.objects["Cube"]

# Get Polygons
for p in o.data.polygons:
    print("Vertex:" + str(p))

If you’re hoping to transform some polygons in edit-mode, you’re going to need to use the BMesh module as well in order for changes to be reflected in real-time. I made a demo of the module recently here.