Convert coordinates from 3d to 2d with projection matrix

How to convert, in python, the 3d coordinates of a point to 2d (projected on a plane), based on a camera Comp? I imagine it must possible with the internal projection matrix of the camera, or something, but my knowledge in that field is pretty limited.