For shapekeys.
[Hunt down link re ID objects and paths]
Basically ID objects get stored in the data of the blend.
path_from_id(property="")
.. method:: path_from_id(property="")
Returns the data path from the ID to this object (string).
:arg property: Optional property name which can be used if the path is
to a property of this object.
:type property: string
:return: The path from :class:`bpy.types.bpy_struct.id_data`
to this struct and property (when given).
:rtype: str
For the key 1 shape value on the context objects mesh
>>> C.object.data.shape_keys.key_blocks['Key 1'].path_from_id('value')
'key_blocks["Key 1"].value'
Ok that's different, let's check the
>>> C.object.data.shape_keys.key_blocks['Key 1'].id_data
bpy.data.shape_keys['Key']
or via
>>> C.object.data.shape_keys
bpy.data.shape_keys['Key']
confirms that the shape keys property on the mesh points to the Keys type ID object in the blend data shape keys collection.
Just like the data
property of a mesh type object points to a mesh
>>> C.object.data
bpy.data.meshes['Cylinder']
If you are going to use shape keys as driver variables then set the ID type to Key and select the set named "Key" in this example.
The data path (RNA is blender jargon how it is stored internally) to this ID object value to put in datapath field (from above)
'key_blocks["Key 1"].value'