I try to do some templates and I need to create something like that:
issuer: QualityHosting AG
fields:
amount: Total EUR\s+(\d+,\d+)
amount_untaxed: Total EUR\s+(\d+,\d+)
date:
- \s{2,}(\d+\. .+ \d{4})\s{2,}
- Rechnungsdatum\s+(\w+ \d+, \d{4})
invoice_number: Rechnungsnr\.\s+(\d{8})
Its not a problem with the regex but with the dict; how can I have fields:amount:
there is my code but I don't think its a correct way
issuer = request.form['issuer']
amount = request.form['amount']
amount_untaxed = request.form['amount_untaxed']
date = request.form['date']
invoice_number = request.form['invoice_number']
start= request.form['start']
keyword= request.form['keyword']
print(issuer, amount,date, amount_untaxed, invoice_number, start, keyword)
di={
"issuer": issuer,
"fields" : {
"amount": amount,
"amount": "1964",
"date": date
}
}
print(di.fiel)
I searched on tutorials but it was not exactly this.