anviz-report-creator
Anviz report creator
Installation
1. Install "pyodbc" according to the instructions: https://github.com/mkleehammer/pyodbc/wiki/Install
2. Clone the repo:
git clone https://github.com/MatthewAllDev/anviz-report-creator
3. Install requirements:
pip install -r requirements.txt
4. (optional) If you want to use converting reports to PDF, get API keys: https://developer.ilovepdf.com/signup
5. Set the database connection settings in “config.json”, as well as the API keys from the previous step
6. Use in console mode or import into your project (see "example" directory)
Installation with Docker
0. First depending on your operating system you need to install and setup docker. You can find out how to install it here. And clone this project.
git clone https://github.com/MatthewAllDev/anviz-report-creator
1. Go to project directory
2. (optional) If you want to use converting reports to PDF, get API keys: https://developer.ilovepdf.com/signup
3. Set the database connection settings in “config.json”, as well as the API keys from the previous step.
4. (optional) If you don't want to use console mode, create your project based on "example" directory
5. (optional) If you want to run the application on a schedule, create a cron task using the command:
python scripts_for_docker/create_cron_task.py
6. Build docker image
docker build -t anviz-rc .
7. Next you can create and run docker container
a) If you want to use this with cron:
docker run -dt -v "{FULL_PATH_TO_HOST_DIR}:/home/app/output" --name anviz-rc anviz-rc
b) If you want to run your application:
docker run -it -v "{FULL_PATH_TO_HOST_DIR}:/home/app/output" --name anviz-rc anviz-rc {APP_CMD}
APP_CMD - is the command to run your app
c) If you want to use console mode:
docker run -it -v "{FULL_PATH_TO_HOST_DIR}:/home/app/output" --name anviz-rc anviz-rc /bin/sh
You can run app with the command:
python /usr/src/app/main.py {arguments}
Usage
main.py [-h] [-efd EXCEL_FILES_DIRECTORY] [-pfd PDF_FILES_DIRECTORY] [-c] start_date finish_date
positional arguments:
start_date - Start date for report
finish_date - Finish date for report
options:
-h, --help - Show help message and exit
-efd, --excel_files_directory - Directory for excel files
-pfd, --pdf_files_directory - Directory for pdf files
-c, --convert_to_pdf - Convert reports to pdf flag
Описание
Набор модулей и скриптов для формирования отчетов приходов / уходов из базы данных Anviz CrossChex | Set of modules and scripts for generating reports of arrivals/departures from the Anviz CrossChex database
Языки
Python
- Dockerfile