You can use PDFMiner which is a Python module for converting PDF to text. You can use the below code to check the version of pdfminer.
import pdfminer
pdfminer.__version__
You can also use the pyPDF which also works fine. If you only want the text with spaces, you can use the following piece of code:-
import pyPdf
pdf = pyPdf.PdfFileReader(open(filename, "rb"))
for page in pdf.pages:
print(page.extractText())