-
-
Save jurand71/862d078cfe24f2d68dcafd869e21ba36 to your computer and use it in GitHub Desktop.
This file contains 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 pandas as pd | |
import PyPDF2 | |
from PyPDF2 import PdfReader | |
reader = PdfReader("mapa_zawartosci_opad.pdf") | |
parts = [] | |
def visitor_body(text, cm, tm, fontDict, fontSize): | |
x = tm[4] | |
y = tm[5] | |
if y < 530 and x < 350: | |
parts.append(text) | |
for page in reader.pages: | |
page.extract_text(visitor_text=visitor_body) | |
text_body = "".join(parts) | |
f = open('stacje_meteo_opad.csv','w') | |
f.write(text_body) | |
f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment