Version 1.3.2
This script parses a pdf schedule to an intelligible ics format.
It uses python 3.8 and higher version
Require poppler-utils package for pdf2image python module
You can run the script with this command :
python3 src/parser.py
Argument | Environnement variable | json parameter | Comment | Default value |
---|---|---|---|---|
-w <folder> , --workdir <folder> |
WORKDIR |
workdir |
Temp folder used by the script | None |
-o <folder> , --output <folder> |
OUTPUT |
output |
Output folder where ics are generated | None |
-c <folder> , --config <file> |
CONFIG |
config |
Config file is localisation | config/config.json |
-d , --detect |
DETECT |
detect |
Save detected element of pdf in the temp folder | false |
-p , --print |
PRINT |
print |
Print classes genarated in stdout | false |
-t <seconds> , --time <seconds> |
TIME |
time |
Run this script in a loop for every TIME seconds | None |
--force |
FORCE |
force |
Force pdf parsing even if it's the same than remote | false |
-h , --help |
/ | / | Show helper for this script | / |
--version |
/ | / | Show version of script | / |
Here is a config sample :
It should be in the config folder named config.json
When one or more ftp connexions are provided, this script uses it and send the file in root folder
To do so you need to setup your FTP credentials by adding a "ftp" key in config.json
file like this :
{
"ftp": [{
"host":"your_host",
"port":21,
"user": "your_user",
"password": "your_password",
"ssl": true
}]
}
There is a Dockerfile build on top of python:3.10-slim
To build it run
docker build -t <tag> .
Variables is the same than variable section.
You have to set :
- a config volume mapped on
/config
- a volume for ics output mapped on
/output
(optional)
You can use the docker compose file to deploy it (volume map has to be changed)