Skip to content

Instantly share code, notes, and snippets.

@vinayak-mehta
Created December 11, 2018 14:16
Show Gist options
  • Save vinayak-mehta/8a3bf37350b241b966483d202a5109b9 to your computer and use it in GitHub Desktop.
Save vinayak-mehta/8a3bf37350b241b966483d202a5109b9 to your computer and use it in GitHub Desktop.
import os
import sys
import pandas as pd
import pdfplumber
pdf = pdfplumber.open(sys.argv[1])
p0 = pdf.pages[0]
table = p0.extract_table()
print table
df = pd.DataFrame(table)
df.to_csv(os.path.splitext(sys.argv[1])[0] + '.csv', index=False, quoting=1, encoding='utf-8')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment