Save and restore
The mindee.Client
includes methods for saving and restoring api calls. Those methods are helpful if you want to perform tests or if you simply want to reload Invoices objects corresponding to your files without performing any additional request.
Save a call
The mindee.Response
object returned by the mindee.Client
when parsing a file is responsible for wrapping all the data from Mindee API calls. It includes a dump
method that can be used as follows:
from mindee import Client
mindee_client = Client(invoice_token="your_invoices_api_token_here")
invoice_data = mindee_client.parse_invoice(open("./sample.pdf", 'rb'), input_type="file")
invoice_data.dump("./test_dump.json")
Restore a call
To restore a client response object, you can use the mindee.Response
as follows:
from mindee import Response
invoice_data = Response.load("./test_dump.json")