Interruption Parser is a microservice that allows one to get data out of KPLC planned power outtage announcement pdfs.
The project uses pdfminer.six to get the text in a pdf document. The text is then parsed to get the relevant information about the planned blackouts.
Before you begin, ensure you have met the following requirements:
- You have installed
python3andpipenv. - You have a
UnixorWindowsmachine.
To install interruption_parser, follow these steps:
Linux and macOS and Windows:
git clone https://github.com/LittleKidogo/interruption_parsercd interruption_parserpipenv install
To use interruption_parser, follow these steps:
pipenv shellpython manage.py run
To try it:
curl --header "Content-Type: application/json" \
--request POST \
--data '{"document_link":"xyz","callback_url":"http://localhost:2300"}' \
http://localhost:5000/
You should get the response
{
"error": null,
"status": "Ok"
}
After a while you should get a request on the supplied callback url of the parsed data.
To contribute to interrupt_parser, follow these steps:
- Fork this repository.
- Create a branch:
git checkout -b <branch_name>. - Make your changes and commit them:
git commit -m '<commit_message>' - Push to the original branch:
git push origin interrupt_parser/<location> - Create the pull request.
Alternatively see the GitHub documentation on creating a pull request.