Migrated pypdf2 to the now active developed pypdf

This commit is contained in:
Ozzie Isaacs 2023-01-22 11:31:47 +01:00
parent 791bc9621a
commit c21a870b8e
3 changed files with 15 additions and 8 deletions

View File

@ -37,16 +37,22 @@ except (ImportError, RuntimeError) as e:
use_generic_pdf_cover = True use_generic_pdf_cover = True
try: try:
from PyPDF2 import PdfReader from PyPDF import PdfReader
use_pdf_meta = True use_pdf_meta = True
except ImportError as ex: except ImportError as ex:
log.debug('PyPDF2 is recommended for best performance in metadata extracting from pdf files: %s', ex) log.debug('PyPDF is recommended for best performance in metadata extracting from pdf files: %s', ex)
try: try:
from PyPDF3 import PdfFileReader as PdfReader from PyPDF2 import PdfReader
use_pdf_meta = True use_pdf_meta = True
except ImportError as e: except ImportError as ex:
log.debug('Cannot import PyPDF3/PyPDF2, extracting pdf metadata will not work: %s / %s', e) log.debug('PyPDF is recommended for best performance in metadata extracting from pdf files: %s', ex)
use_pdf_meta = False log.debug('PyPdf2 is also possible for metadata extracting from pdf files, but not recommended anymore')
try:
from PyPDF3 import PdfFileReader as PdfReader
use_pdf_meta = True
except ImportError as e:
log.debug('Cannot import PyPDF3/PyPDF2, extracting pdf metadata will not work: %s / %s', e)
use_pdf_meta = False
try: try:
from . import epub from . import epub

View File

@ -7,7 +7,7 @@ Flask-Principal>=0.3.2,<0.5.1
backports_abc>=0.4 backports_abc>=0.4
Flask>=1.0.2,<2.2.0 Flask>=1.0.2,<2.2.0
iso-639>=0.4.5,<0.5.0 iso-639>=0.4.5,<0.5.0
PyPDF2>=1.28,<3.1.0 PyPDF>=3.0.0,<3.3.0
pytz>=2016.10 pytz>=2016.10
requests>=2.11.1,<2.28.0 requests>=2.11.1,<2.28.0
SQLAlchemy>=1.3.0,<1.5.0 SQLAlchemy>=1.3.0,<1.5.0

View File

@ -23,6 +23,7 @@ classifiers =
Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Operating System :: OS Independent Operating System :: OS Independent
keywords = keywords =
calibre calibre
@ -46,7 +47,7 @@ install_requires =
backports_abc>=0.4 backports_abc>=0.4
Flask>=1.0.2,<2.2.0 Flask>=1.0.2,<2.2.0
iso-639>=0.4.5,<0.5.0 iso-639>=0.4.5,<0.5.0
PyPDF2>=1.28,<3.1.0 PyPDF>=3.0.0,<3.3.0
pytz>=2016.10 pytz>=2016.10
requests>=2.11.1,<2.28.0 requests>=2.11.1,<2.28.0
SQLAlchemy>=1.3.0,<1.5.0 SQLAlchemy>=1.3.0,<1.5.0