Insert Cat Picture

My wife and sometimes other people ask me to send them research papers that are not publicly available which I am more than happy to do. However, why should I not have some fun with the final document I send her. I use the excellent, although sadly deprecated PyPdf. I have not checked out pyPdf2 but it does look promising. Here is the gist for how I randomly add an image (usually of a cat) to the pdf document and then rename it since most research sites name their documents similar to the DOI for the paper.