Mesh decimation on certain points

Hi, my name’s Anton and I’m new to Blender and to this forum. I’m trying to work out if Blender is the right tool for a particular task: I want to decimate a mesh but I don’t want all verts included in the decimation, meaning, I’d like to preserve parts of the mesh and decimate others. Is there a way to do this programatically in blender’s Python?