Skip to content

Instantly share code, notes, and snippets.

@ceaksan
Created August 10, 2021 07:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ceaksan/25034d9bd4496ea953082d2cfa831ad1 to your computer and use it in GitHub Desktop.
Save ceaksan/25034d9bd4496ea953082d2cfa831ad1 to your computer and use it in GitHub Desktop.
#!pip install PyPDF2
import urllib.request, io, PyPDF2
import pandas as pd
url = "https://fenbil.aku.edu.tr/FENBILENS/takvim/2014-2022-1RESMI.pdf"
remoteFile = urllib.request.urlopen(url)
pdfReader = PyPDF2.PdfFileReader(io.BytesIO(remoteFile.read()))
for i in range(pdfReader.numPages):
with open('pdf.txt', 'a+') as file:
file.write(pdfReader.getPage(i).extractText())
df = pd.read_csv('/content/pdf.txt', delimiter = "\n", names=['date'])
df.head()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment