Accessing/creating nodes with python?

I’ve took a hunt through the Python API docs but haven’t been able to find anything on this, though it might be that I’ve missed the pertinent info.

Are any aspects of the node editor exposed to the Python API? Specifically adding and manipulating standard nodes (both material and compositing). This isn’t essential functionality for what I’m trying to do, but would certainly help to cut down unnecessary user input for some tasks that could be automated.