While we should reach for prior art, something like this bit of python is good for the hip pocket for those moments when PlantUML might not support some zany requirement.