How to change a Geometry Node field value using a Python Script

I would like to read and change a value in the Geometry Node editor using a python script. If for example I want to change the Density in the PointDistribution node, how would this be doing using a Python script?

I tried this to get started:

node_group = bpy.data.node_groups['Point Distribute']


• Related, blender.stackexchange.com/questions/222535/… .. unfortunately @Gorgious removed his answer ... but could by the looks add it here. , if gm = context.active_object.modifiers.get("GeometryNodes") is the modifier, then gm.node_group is the node group. Jul 13 '21 at 19:19