Validates the German Tax-ID (Steuerliche Identifikationsnummer, short: Steuer-ID) using Python.
Based on the official ELSTER documentation (chapter: 2).
Note
This package validates solely the syntax and check digit of the provided input. It does not confirm, that the validated Steuer-ID was assigned to a person. Please contact the Bundeszentralamt für Steuern in case you are unsure about your Steuer-ID.
An example of how it can be used:
from steuerid import SteuerId
validation_result = SteuerId.validate("02476291358")
print(validation_result) # (True, None) -> the provided input is a valid steuer id
validation_result = SteuerId.validate("x1234567890")
print(validation_result) # (False, OnlyDigitsAllowedException) -> invalid input, only digits are allowed
Support for test Steuer-IDs (starting with 0
) is enabled by default. Test Steuer-IDs are typically invalid in production. It is recommended to disable them with the following environment variable:
STEUERID_PRODUCTION=true
For development first clone the repo. It is recommended to create a virtual env
and activate that virtual env. Inside the venv install the dependencies using
poetry install
command.
Execute pytest
to run the unit tests:
pytest
The MIT License (MIT). Please see License File for more information.