It is an OCR program with document recognition. The problem is there are many passport format and languages used, you need to build an engine to identify.
python + OpenCV is what currently used most for these tasks. Go to github, there are many project did this.
It you want to skip the above, using Google Cloud Vision or MS Azure Cognitive Service. Their OCR and document recognition engine can did the job.