hyperboria/nexus/pylon/pdftools/__init__.py
the-superpirate 7389f85ef2 - Send Pylon to golden
-  Move fancy naming to Hub
-  Adopt translations
-  Fix long authors list in bot
-  Support CJK in scitech
-  Fixed pylon bug with decoding improper unicode ch...

GitOrigin-RevId: 74f73c44f749a71cb65dd5ddd3416f32a83d329f
2021-01-08 23:09:19 +03:00

10 lines
192 B
Python

from pdfminer.high_level import extract_text
def is_pdf(path_to_file):
try:
extract_text(path_to_file, maxpages=1)
return True
except Exception:
return False