Open oonisim opened 7 months ago
In this case the docstring is incorrect, Key is a list of Words as per the Textract API documentation https://docs.aws.amazon.com/textract/latest/dg/how-it-works-kvp.html
I can make .words
into an EntityList
object so you may be able to call get_text()
on it. Let me create a PR to update the docstring.
It still won't return a Line
, but #320 should address your use case.
for kv in document.key_values:
key = kv.key
value = kv.value
key_text = key.text
value_text = value.text
Thank you for the update.
KeyValue class key property says that it returns
Line
.However, it returns Python List[Word] and there is no text property available which the Line class to have.
Environment
Reproduction
PDF