This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from tika import parser | |
| import os | |
| def extract_text_from_pdfs_recursively(dir): | |
| for root, dirs, files in os.walk(dir): | |
| for file in files: | |
| path_to_pdf = os.path.join(root, file) | |
| [stem, ext] = os.path.splitext(path_to_pdf) | |
| if ext == '.pdf': |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| import os | |
| class Settings: | |
| _config_location = 'config.json' | |
| def __init__(self): | |
| if os.path.exists(self._config_location): | |
| self.__dict__ = json.load(open(self._config_location)) |