You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
1.0 KiB

5 years ago
import os
from .reader import reader
from .formatter import formatter
from .writer import writer
table_names = ['Bellen binnen Nederland', 'Bellen in het buitenland', 'Bellen naar het buitenland', 'Ontvangen gesprekken in het buitenland', 'Servicenummers - dienst', 'Servicenummers - verkeer', 'Servicenrs btw-vrij - dienst', 'Servicenrs btw-vrij - verkeer', 'Sms-berichten', 'Sms-en in het buitenland']
first_column_names = ['Gekozen nummer', 'Land en nummer', 'Bestemming', 'Land en bestemming']
writer = writer()
reader = reader(writer, table_names, first_column_names)
def extract(path, save_dir = os.getcwd()):
writer.set_save_dir(save_dir)
if path[-4:] == '.pdf':
reader.load(path)
reader.read_pdf()
elif os.path.isfile(path):
print('please parse a pdf file or folder with pdf files.')
return
else:
for filename in sorted(os.listdir(path)):
if filename[-4:] == '.pdf':
reader.load(os.path.join(path, filename))
reader.read_pdf()