Access Mapping node with python
Since Mapping is a shader tree node, a 'material reference' is required:

import bpy
import math

# get the material
mat = bpy.data.materials['Material']

# get all material nodes
nodes = mat.node_tree.nodes

# get the mapping node
map_node = nodes.get("Mapping")

# set the rotation z component
map_node.rotation[2] = math.radians(180)


Direct access:

rot_z = math.radians(180)
bpy.data.materials['Material'].node_tree.nodes['Mapping'].rotation[2] = rot_z


Result:



Other properties

# set the vector type to 'TEXTURE'`, 'POINT', 'VECTOR' or 'NORMAL'
map_node.vector_type = "NORMAL"

# set the location components
map_node.translation = (0, 1, 3)

# set scale values
map_node.scale = (1, 0.5, 1)

# use minimum clipping value
map_node.use_min = True
map_node.min = (1,1,1)

# use max clipping value
map_node.use_max = True
map_node.max = (0,0,1)


Result:





For the world environment it's basically the same:

# get the world
world = bpy.data.worlds['World']

# get all material nodes
nodes = world.node_tree.nodes

# get the mapping node
map_node = nodes.get("Mapping")

# set the rotation z component
map_node.rotation[2] = math.radians(180)


Direct access:

rot_z = math.radians(180)
bpy.data.worlds['World'].node_tree.nodes["Mapping"].rotation[2] = rot_z


Result: