Using Python to Edit PDF Files
I had a need to edit a batch of PDF files to remove some sensitive information such as account numbers and replace them with asterisks (*). When looking at some of the programs that are available to edit PDF’s they seemed to be mostly paid programs that didn’t have good batch options.
Writing a program in Python seemed like an interesting option and I did a quick survey of some of the existing packages. PyPDF2 looked to be a good library and had some examples on the web on how to do something similar, especially this particular gist: Redact phrases of text from a PDF.