Module Import alias Import alias Import alias ImportFrom alias ImportFrom alias alias alias Import alias Import alias Import alias Import alias identifier Import alias identifier ImportFrom alias ImportFrom alias Import alias ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Str Assign NameStore Dict Str Str Str Str Str Str Str Str NameLoad NameLoad NameLoad Str ListLoad ListLoad Str ListLoad FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body If NameLoad body Expr Call AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr Assign NameStore Dict If CompareIs NameLoad NameLoad body Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Str Str Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Str Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr Call NameLoad NameLoad For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr If CompareIn Str NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str If SubscriptLoad NameLoad Index Str body Assign NameStore Call AttributeLoad NameLoad attr Str Str NameLoad orelse Assign NameStore NameLoad If SubscriptLoad NameLoad Index Str body Assign NameStore Call NameLoad NameLoad For NameStore SubscriptLoad NameLoad Index Str body Assert CompareEq Call NameLoad NameLoad Num Str Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num If Call NameLoad ListComp CompareIn NameLoad NameLoad comprehension NameStore SubscriptLoad NameLoad Index Str body Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Str Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Index Str For NameStore NameLoad body Assert CompareEq Call NameLoad NameLoad Num Str Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad For TupleStore NameStore NameStore Call AttributeLoad SubscriptLoad NameLoad Index Str attr body If Call AttributeLoad NameLoad attr Str body Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad Assign SubscriptStore NameLoad Index Call AttributeLoad NameLoad attr Str Str NameLoad orelse Expr Call AttributeLoad NameLoad attr Str NameLoad NameLoad If CompareIs Call NameLoad NameLoad NameLoad body For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If NameLoad body Break orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr Str NameLoad If Call AttributeLoad NameLoad attr Str body Assign NameStore SubscriptLoad NameLoad Index Num Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad NameLoad attr NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Index NameLoad If UnaryOpNot SubscriptLoad NameLoad Index NameLoad body Expr Call AttributeLoad NameLoad attr Str NameLoad Return NameLoad orelse If Call AttributeLoad NameLoad attr Str body Assert CompareLt Call AttributeLoad SubscriptLoad NameLoad Index Num attr NameLoad Num Str Assign NameStore Call AttributeLoad SubscriptLoad NameLoad Index Num attr NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Str Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str Str Assign SubscriptStore NameLoad Index NameLoad Call NameLoad NameLoad orelse Assign SubscriptStore NameLoad Index NameLoad SubscriptLoad NameLoad Index Num orelse Expr Call AttributeLoad NameLoad attr Str NameLoad If CompareNotIn Str Call AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad SubscriptLoad NameLoad Index Str Index Num orelse Assign NameStore SubscriptLoad NameLoad Index Str Assign SubscriptStore NameLoad Index Str SubscriptLoad NameLoad Index Str If CompareGtE Call NameLoad Call AttributeLoad NameLoad attr Num body Assign SubscriptStore NameLoad Index Str BinOpMod Str TupleLoad SubscriptLoad NameLoad Index Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad orelse Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str Str keyword Str keyword Call AttributeLoad NameLoad attr Str Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Call AttributeLoad NameLoad attr Str keyword Str keyword Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore ListLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr For NameStore AttributeLoad NameLoad attr body Assign NameStore Call NameLoad AttributeLoad NameLoad attr keyword NameLoad keyword AttributeLoad NameLoad attr If NameLoad body Print NameLoad Expr Call AttributeLoad NameLoad attr NameLoad If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr keyword Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str keyword SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr NameLoad Expr Call NameLoad NameLoad Str decorator_list If CompareEq NameLoad Str body Expr Call NameLoad
N/A N/A re N/A argparse N/A shutil os listdir os.path isfile isdir join N/A locale N/A dateparser N/A pkg_resources N/A invoice2data.pdftotext pdftotext N/A invoice2data.image_to_text image_to_text invoice2data.templates read_templates invoice2data.output invoices_to_csv N/A logging unidecode unidecode N/A logger N/A N/A logging getLogger __name__ N/A FILENAME {date} {desc}.pdf N/A OPTIONS_DEFAULT N/A remove_whitespace remove_accents lowercase currency date_formats languages decimal_separator replace False False False EUR N/A N/A . N/A extract_data N/A N/A invoicefile templates debug N/A None False N/A N/A debug N/A N/A N/A N/A logging basicConfig level N/A logging DEBUG N/A output N/A N/A N/A templates None N/A N/A templates N/A read_templates N/A N/A pkg_resources resource_filename invoice2data templates N/A extracted_str N/A N/A N/A N/A pdftotext to_text invoicefile decode utf-8 N/A charcount N/A len extracted_str N/A N/A N/A logger debug number of char in pdf2text extract: %d charcount N/A N/A N/A logger debug START pdftotext result =========================== N/A N/A N/A logger debug extracted_str N/A N/A N/A logger debug END pdftotext result ============================= N/A N/A N/A logger debug N/A N/A Testing {} template files format N/A len templates N/A t templates N/A N/A run_options N/A N/A OPTIONS_DEFAULT copy N/A N/A options t N/A N/A N/A N/A run_options update N/A t N/A options N/A N/A run_options N/A remove_whitespace N/A N/A optimized_str N/A N/A re sub  + extracted_str N/A N/A optimized_str extracted_str N/A N/A run_options N/A remove_accents N/A N/A optimized_str N/A unidecode optimized_str N/A replace N/A run_options N/A replace N/A N/A N/A N/A len replace 2 A replace should be a list of 2 items N/A optimized_str N/A N/A optimized_str replace N/A replace N/A 0 N/A replace N/A 1 N/A N/A all N/A N/A keyword optimized_str N/A keyword N/A t N/A keywords N/A N/A N/A N/A logger debug Matched template %s N/A t N/A template_name N/A N/A N/A logger debug START optimized_str ======================== N/A N/A N/A logger debug optimized_str N/A N/A N/A logger debug END optimized_str ========================== N/A date_formats N/A run_options N/A date_formats N/A languages N/A run_options N/A languages N/A decimal_sep N/A run_options N/A decimal_separator N/A lang languages N/A N/A N/A N/A len lang 2 lang code must have 2 letters N/A N/A N/A logger debug Date parsing: languages=%s date_formats=%s languages date_formats N/A N/A N/A logger debug Float parsing: decimal separator=%s decimal_sep N/A N/A N/A logger debug keywords=%s N/A t N/A keywords N/A N/A N/A logger debug run_options N/A N/A k v N/A N/A N/A t N/A fields items N/A N/A N/A N/A k startswith static_ N/A N/A N/A N/A logger debug field=%s | static value=%s k v N/A N/A output N/A N/A N/A k replace static_ v N/A N/A N/A N/A logger debug field=%s | regexp=%s k v N/A N/A N/A type v list N/A N/A v_option v N/A N/A res_find N/A N/A re findall v_option optimized_str N/A res_find N/A N/A N/A N/A res_find N/A N/A re findall v optimized_str N/A res_find N/A N/A N/A N/A logger debug res_find=%s res_find N/A N/A N/A k startswith date N/A N/A raw_date N/A res_find N/A 0 N/A N/A output N/A k N/A N/A dateparser parse raw_date date_formats date_formats languages languages N/A N/A N/A logger debug result of date parsing=%s N/A output N/A k N/A N/A N/A output N/A k N/A N/A N/A N/A logger error Date parsing failed on date '%s' raw_date N/A None N/A N/A N/A N/A k startswith amount N/A N/A N/A N/A N/A N/A res_find N/A 0 count decimal_sep 2 Decimal separator cannot be present several times N/A amount_pipe N/A N/A N/A res_find N/A 0 replace decimal_sep | N/A amount_pipe_no_thousand_sep N/A N/A re sub [.,\s] amount_pipe N/A amount_regular N/A N/A amount_pipe_no_thousand_sep replace | . N/A N/A output N/A k N/A float amount_regular N/A N/A N/A output N/A k N/A res_find N/A 0 N/A N/A N/A N/A logger warning regexp for field %s didn't match k N/A N/A issuer N/A N/A t keys N/A N/A identifier N/A N/A t N/A keywords N/A 0 N/A N/A identifier N/A t N/A issuer N/A N/A output N/A currency N/A run_options N/A currency N/A N/A N/A len N/A N/A output keys 4 N/A N/A N/A output N/A desc N/A Invoice %s from %s N/A N/A output N/A invoice_number identifier N/A N/A N/A logger debug output N/A output N/A N/A N/A N/A logger error Missing some fields for file %s invoicefile N/A N/A N/A logger error output N/A None N/A N/A N/A logger error No template for %s invoicefile N/A N/A N/A logger debug output N/A False N/A main N/A N/A N/A N/A N/A Take folder or single file and analyze each. N/A parser N/A N/A argparse ArgumentParser description Process some integers. N/A N/A N/A parser add_argument --debug dest debug action store_true help Print debug information. N/A N/A N/A parser add_argument --copy -c dest copy help Copy renamed PDFs to specified folder. N/A N/A N/A parser add_argument --template-folder -t dest template_folder default N/A N/A pkg_resources resource_filename invoice2data templates help Folder containing invoice templates in yml file. Required. N/A N/A N/A parser add_argument input_files type N/A N/A argparse FileType r nargs + help File or directory to analyze. N/A args N/A N/A parser parse_args N/A output N/A N/A templates N/A read_templates N/A args template_folder N/A f N/A args input_files N/A N/A res N/A extract_data N/A f name templates templates debug N/A args debug N/A res N/A N/A res N/A N/A N/A output append res N/A N/A args copy N/A N/A filename N/A N/A FILENAME format date N/A N/A N/A res N/A date strftime %Y-%m-%d desc N/A res N/A desc N/A N/A N/A shutil copyfile N/A f name N/A join N/A args copy filename N/A N/A invoices_to_csv output invoices-output.csv N/A N/A N/A __name__ __main__ N/A N/A N/A main