add pdf
This commit is contained in:
BIN
pdf/01.png
Normal file
BIN
pdf/01.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 115 KiB |
BIN
pdf/02.png
Normal file
BIN
pdf/02.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 78 KiB |
BIN
pdf/03.png
Normal file
BIN
pdf/03.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 52 KiB |
BIN
pdf/04.png
Normal file
BIN
pdf/04.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 74 KiB |
16
pdf/pdf.py
Normal file
16
pdf/pdf.py
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import pdfplumber
|
||||||
|
import pandas as pd
|
||||||
|
|
||||||
|
with pdfplumber.open("test.pdf") as pdf:
|
||||||
|
first_page = pdf.pages[0]
|
||||||
|
text = first_page.extract_text()
|
||||||
|
print(text)
|
||||||
|
|
||||||
|
second_page = pdf.pages[1]
|
||||||
|
table = second_page.extract_tables()
|
||||||
|
for t in table:
|
||||||
|
df = pd.DataFrame(t[1:],columns=t[0])
|
||||||
|
print(df)
|
||||||
|
|
||||||
BIN
pdf/test.pdf
Normal file
BIN
pdf/test.pdf
Normal file
Binary file not shown.
Reference in New Issue
Block a user