I want to use Python Slate
module for PDF text extraction, and I have my code up and running for this. What I would like to know here is how to link my existing PHP MVC
to utilize/make a request to Python slate Script for PDF extarction. The option I thought of are :
-
Using PHP
shell_exec
orpassthru
orexec
command fromPhp
script to call python script(Slate/PDF MINER) , with the desired pdf file path. -
Or Making PHP to interact with Python Django/DRF (where the Slate script will reside). More precise may be an API call (
RESTFUL
architecture) to DRF. -
Or may be running a single python script on
wscgi
which can be called byphp
script.
This three options coming in my mind, and I want to keep things simple here.
Is their any other better option or better way to achieve this ? Please give me your feedback.