Giter Club home page Giter Club logo

lexoffice-invoice-upload's Introduction

Lexoffice Invoice Upload

CodeQL

Build and Publish

Test

Upload your invoices from email attachements automatically to Lexoffice.

Usage

Usage with Docker

See docker-compose.yml for an example configuration.

After starting the container once, it will generate a default config.ini in the volume /app/config/. Alternatively you can copy the example config.ini in this repository. Change the settings in that file and then restart the container. You can add as many configuration files as you like to this directory and also name them as you like. The program will iterate over all of them in alphabetical order.

Tags

  • Use the latest tag, to benefit from weekly updates for packages and security patches even between released versions.
  • Use the version tags for fixed image states.

Environment variables

You can adjust some options in the container with the following environment variables:

Name Description Default
CRON Defines the check schedule in a Cron-like expression.
See crontab.guru for examples and help.
*/5 * * * *
TZ Defines the time zone in the container in TZ data format. Europe/Berlin

Usage on CLI

Installation / Setup

  1. Install requirements pip install -r requirements.txt (Also see Requirements section below)
  2. Specify your configuration in config.ini (you can generate a config file with python3 main.py --generate or python3 main.py --generate --configfile /my/destination/mycustomconfig.conf)
  3. Run python3 main.py
  4. Mails in specified maildir will automatically be searched for attachements with the configured file extension, then downloaded und uploaded to Lexoffice via their API.

Requirements

  • See requirements.txt
  • pycurl: The installation of pycurl can give you a hard time. Here is what worked for me on Windows, MacOS and Ubuntu.
    • Windows: If installation fails you can try to install from the unofficial binary, see this stackoverflow comment for more details)
    • MacOS: Run the following
      brew install openssl
      export PYCURL_SSL_LIBRARY=openssl
      export LDFLAGS="-L/opt/homebrew/opt/openssl@3/lib"
      export CPPFLAGS="-I/opt/homebrew/opt/openssl@3/include"
      pip3 install --no-cache-dir --ignore-installed --compile --install-option="--with-openssl" pycurl
    • Linux: (tested on Ubuntu 20.04)
      1. Install requirements:

        apt install libssl-dev libcurl4-openssl-dev libcurl4-gnutls-dev libgnutls-dev python3-dev

        If you get the error Package libgnutls-dev is not available, then instead of libgnutls-dev install libgnutls28-dev

        If this also doesn't work (or apt says you have unmet dependencies), try to install everything with aptitude instead of apt:

        aptitude install libssl-dev libcurl4-openssl-dev libcurl4-gnutls-dev python3-dev
      2. Then install pycurl:

        pip3 install pycurl

CLI Arguments

  • -h, --help show the help message
  • -f FILE, --configfile FILE specify the config file to use. If nothing is specified, ./config.ini will be used. Use * as wildcard to specify multiple config files (config_*.ini)
  • -q, --quiet don't print status messages to stdout.
  • -g, --generate generate a new configruation file, optionally specify path and filename with --config argument.
  • -l, --loop, --continuous Enable loop/continuous mode. In this mode, the script runs through the given configuration(s) in an infinite loop. The default interval between each run is 120 seconds.
  • -c "m h dom mon dow", --cron "m h dom mon dow" specify the schedule in cron-style format (minute hour day-of-month month day-of-week). See https://crontab.guru/ for examples and help about schedule expressions. Only takes effect in loop/continuous mode. Default is 5 minutes.

CLI with multiple config files

If you have more than one mailbox to check or want to separate you configurations, you can create multiple config files and iterate/loop over them like with a simple bash script:

# Generate config files from template with specific destination and file name
python3 main.py --generate --configfile /path/to/config/mailbox_tom.ini
python3 main.py --generate --configfile /path/to/config/aws-invoices.ini
python3 main.py --generate --configfile /path/to/config/amazon_business.ini

# Run program with multiple configuration files
python3 main.py --configfile /path/to/config/config*.ini >> logfile.log

lexoffice-invoice-upload's People

Contributors

kimdre avatar patti2 avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

patti2 m7salam

lexoffice-invoice-upload's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
Main configs and useful links are located in Maki-IT/renovate-config; Renovate logs for debug here.

This repository currently has no open or pending branches.

Detected dependencies

docker-compose
docker-compose.yml
dockerfile
Dockerfile
  • python 3-alpine3.18
github-actions
.github/workflows/build.yaml
  • actions/checkout v4
  • docker/setup-qemu-action v3
  • docker/setup-buildx-action v3
  • docker/login-action v3.2.0
  • docker/login-action v3.2.0
  • docker/metadata-action v5
  • docker/build-push-action v5
.github/workflows/test.yaml
  • actions/checkout v4
  • actions/setup-python v5
  • awalsh128/cache-apt-pkgs-action v1.4.2
pip_requirements
requirements.txt
  • configparser ~=7.0.0
  • columnar ~=1.4.1
  • pycurl ~=7.45.3
  • cron-validator ~=1.0.8

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.