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 passport 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(passport_token="your_passport_token_here")

passport_data = mindee_client.parse_passport("./passport.jpg")

passport_data.dump("./passport_dump.json")

 

 

Restore a call

 

To restore a client response object, you can use the mindee.Response as follows:

 

from mindee import Response

passport_data = Response.load("./passport_dump.json")