init commit

This commit is contained in:
2022-04-26 13:03:02 -05:00
commit 8e65dcb06d
8 changed files with 1144 additions and 0 deletions

13
parse_text/read_pdf.py Normal file
View File

@@ -0,0 +1,13 @@
import fitz
import sys
def read_PDF(path):
with fitz.open(path) as doc:
text = ""
for page in doc:
text += page.get_text()
with open(f'../recipe_text/{text[:20]}.txt', 'w') as f:
f.write(text)
read_PDF('../recipes/sample_recipe.pdf')
sys.stdout.flush()