Giter Club home page Giter Club logo

vwkommi's Introduction

VW Kommi

VW Kommi is a simple tool to read out commission numbers of VW ID vehicles.

Outline

Install Requirements

The following requirements are needed to run VW Kommi:

  • Python 3.8 (or newer)
  • pip
  • virtualenv (optional)

Linux

The following steps are based on Ubuntu 18.04. Other distributions may work in a similar way.

First install the needed packages.

sudo apt install python3.8 python3.8-venv

Then install virtualenv.

python3.8 -m pip install virtualenv

The command will install the virtualenv binary to ~/.local/bin. So add your local bin directories to your PATH system environment variable. Therefore open ~/.bashrc and add the following line to the end if it is not already there:

PATH=$PATH:~/.local/bin:~/.local/sbin

Windows

Download Python 3 from the Python Download Website. Following the setup you should bbe able to also install pip. Be sure to add the Python-Path and Scripts to your Path to make the commands available.

After installing Python install virtualenv.

pip install virtualenv

Create virtual environment (optional)

Using virtualenv is not needed but keeps the system installation of Python clean. So I recommend using it!

Create a virtual environment and cd to it.

python -m venv vwkommi
cd vwkommi

Attention: Depending on the system python3.8 needs to be used as command.

Activate the virtual environment.

. bin/activate

Attention Windows users: The above command is different using windows:

Scripts\activate

If the above command worked you can see that the environment is active by (vwkommi) in front of the command line.

Install VW Kommi

Clone the project. If you are using virtualenv change to its directory and activate it first (see section Create virtual environment)!

git clone https://github.com/SushiTee/vwkommi.git

The last thing to do is installing the package. Therefor go into the checked out project directory and install the package using pip.

cd vwkommi
pip install -e .

The parameter -e stands for editable. This means all local changes to the project or updates will be applied without needing to reinstall the package.

Settings

In the subdirectory vwkommi a settings_local.py.example can be found. It is to set local settings for your installation. copy the file like so:

cp settings_local.py.example settings_local.py

All settings made there override the default settings set in settings_default.py.

Make sure you enter your user data within the settings_local.py.

The range of the commission numbers to be requested can be set as well.

Usage

As VW Kommi is a python module it is run using the -m parameter of the python command:

python -m vwkommi <subcommand>

The following subcommands are available:

  • request - Requests data from VW and stores them into the raw_data directory

Within the settings_local.py you can set the range commission numbers to be requested.

request sub command

The request sub command supports two additional options:

  • -f, --find-prefix - Find the prefix and year of a commission number
    python -m vwkommi request -f AL1234
  • -a, --add-to-profile - Tries to add a car with a given commission to your profile
    python -m vwkommi request -a AL1234

Additionally the settings set via settings_default.py or settings_local.py can be overwritten by the command line:

  • -b, --base-dir - The directory where the downloaded data is stored. An additional directory called raw_data will be created in the selected directory.
    python -m vwkommi request -b /home/user/vwdata
  • -w, --worker-count - The number of workers to be used to make requests (default: 30)
    python -m vwkommi request -w 20
  • -u, --username - The username of your account on the VW website
    python -m vwkommi request -u example
  • -p, --password - The password of you account on the VW website
    python -m vwkommi request -p example
  • -P, --prefix-list - The prefixes for commission numbers which are tried (default [185,900,877,902]).
    python -m vwkommi request -P [123,444]
    The default value is for ID.3, ID.4 and ID.5 vehicles.
  • -s, --skip-fin-details - Set to True to request additional VIN details. It may be very slow (default: True).
    python -m vwkommi request -s True
  • -c, --commission-number-range - Sets the ranges to be requested. The value is a list containing lists with four elements. The inner lists elements consist of the character part of the commission number. The next two elements are the actual range. The last element contains the number of characters of the number part.
    python -m vwkommi request -c '[[\"AF\",0,5000,4],[\"AH\",123,123,4]]'

Run with Docker

Instead of installing local environment you can build a docker image and run vwkommi with docker. To build the docker image execute:

docker build -t vwkommi .

To run the image create a settings_local.py (here under /srv/vwkommi/settings_local.py) and execute the following command:

docker run --rm -v /srv/vwkommi/raw_data/:/work/vwkommi/raw_data -v /srv/vwkommi/settings_local.py:/work/vwkommi/settings_local.py vwkommi:latest request

You will find then the .json files in the directory /srv/vwkommi/raw_data/.

vwkommi's People

Contributors

bagges avatar sushitee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

ngtdxdd

vwkommi's Issues

VW server changes?

I did have a check for my kommision number as chron job for a few months now, but it stopped working today.
I cannot even get the prefix with anymore
python3 -m vwkommi request -f XXYYYY

Anybody else having that issue?

Request single commission number

Would be nice to have the feature to request a single commission number with -s or something. Maybe also with username(-u) and password(-p) as parameter of vwcommi. Would make the settings_local.py for this call superfluous. What do you mean?

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.