pymupdf

Python bindings for MuPDF PDF toolkit and renderer

brewmacoslinux
Try with needOr install directly
Source

About

Python bindings for the PDF toolkit and renderer MuPDF

Commands

pymupdf

Examples

Extract text from a PDF file$ python3 -c "import fitz; doc = fitz.open('document.pdf'); print(doc[0].get_text())"
Convert PDF pages to images$ python3 -c "import fitz; doc = fitz.open('document.pdf'); pix = doc[0].get_pixmap(); pix.save('page.png')"
Merge multiple PDF files$ python3 -c "import fitz; doc = fitz.open(); doc.insert_pdf(fitz.open('file1.pdf')); doc.insert_pdf(fitz.open('file2.pdf')); doc.save('merged.pdf')"