项目作者: franzs

项目描述 :
Webbot for entering timesheets to ProCon
高级语言: Python
项目地址: git://github.com/franzs/procon-webbot.git
创建时间: 2021-03-27T08:25:59Z
项目社区:https://github.com/franzs/procon-webbot

开源协议:GNU General Public License v3.0

下载


procon-webbot

Webbot for entering timesheets from CSV to ProCon using Selenium written in Python.

Limitations

At the moment it is possible to enter a timesheet for the current month, only. Furthermore it is not possible to divide the hours into several units. The working time is copied to a fixed unit.

Only Firefox is supported.

Prerequisites

Webdriver for Selenium

Download geckodriver and install it for your operating system.

Python packages

  1. pip install -r requirements.txt

Certificate database

If your company is unable to provide a complete certificate chain, you may need to provide intermediate certificates yourself. All certificates from the certs subdirectory are put into a nss database which is used by Firefox then:

  1. ./create_cert_db.sh

Usage

Username and password have to be set via environment variables, e. g.

  1. export PROCON_USERNAME=hartarbeiterhar
  2. export PROCON_PASSWORD=ja3kqfJRd2gW

All other parameter can be set via environment variables or command line arguments:

Environment variable Command line argument Description Default
PROCON_URL --url Base URL of ProCon
PROCON_COST_CENTER --costcenter Name of costcenter as displayed in ProCon
PROCON_COLUMN_NAME_DATE --column-name-date Name of date column in CSV file
PROCON_COLUMN_NAME_START --column-name-start Name of start column in CSV file
PROCON_COLUMN_NAME_END --column-name-end Name of end column in CSV file
PROCON_COLUMN_NAME_PAUSE --column-name-pause Name of pause column in CSV file
PROCON_CSV_FORMAT_DATE --csv-format-date Name of pause column in CSV file %d.%m.%Y
PROCON_CSV_FORMAT_TIME --csv-format-time Name of pause column in CSV file %H:%M
PROCON_CSV_DELIMITER --csv-delimiter Name of pause column in CSV file ;
PROCON_CSV_QUOTE_CHAR --csv-quote-char Name of pause column in CSV file "

For example:

  1. export PROCON_URL=https://procon.goetterbote.de/
  2. export PROCON_COST_CENTER="123 SK0815 Migration to Cloud"

Imagine you have a CSV file with the following content:

  1. Datum;Tag;Ein;Aus;Pause;Total;Total (dezimal)
  2. 01.03.2021;Mo;08:00;17:00;01:00;08:00;08.00

Then you would set in addition:

  1. export PROCON_COLUMN_NAME_DATE="Datum"
  2. export PROCON_COLUMN_NAME_START="Ein"
  3. export PROCON_COLUMN_NAME_END="Aus"
  4. export PROCON_COLUMN_NAME_PAUSE="Pause"

Finally you can execute the webbot:

  1. ./procon-webbot.py timesheet.csv