I should add to Cameron’s note here that this would be a very interesting addition to the code base, if you are interested in working on it and submitting it for inclusion in yt. Others should comment on the best place for it to go in the code.
I don't know of any automatic way of doing this that already exists within yt. I think an iterative method where you start with a tiny sphere and increment the radius until you get the desired mass will be your best bet.
yt-users mailing email@example.com