Files
contabilidad/python/src/main.py

23 lines
641 B
Python
Raw Normal View History

2021-11-01 11:00:59 -03:00
import argparse
import os
import contabilidad.pdf as pdf
2021-11-02 15:37:36 -03:00
import contabilidad.text_handler as th
2021-11-01 11:00:59 -03:00
def main(args):
filename = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', 'data', args.filename))
2021-11-02 15:37:36 -03:00
obj = pdf.get_data(filename, args.password)
2021-11-01 11:00:59 -03:00
print(obj)
2021-11-02 15:37:36 -03:00
obj = pdf.get_text(filename, args.password)
text = th.text_cleanup(obj, filename=str(args.filename))
print(text)
2021-11-01 11:00:59 -03:00
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-f', '--filename', type=str)
parser.add_argument('-p', '--password', type=str, default='')
_args = parser.parse_args()
main(_args)