Installation
KSeF2 requires Python 3.12 or newer.
pip install ksef2With uv:
uv add ksef2Optional extras
Section titled “Optional extras”Install PDF support only when you need local invoice visualization:
pip install "ksef2[pdf]"uv add "ksef2[pdf]"Runtime type checks are optional and disabled by default. Enable them during
development or debugging with the runtime-checks extra:
pip install "ksef2[runtime-checks]"KSEF2_RUNTIME_CHECKS=1 python -c "import ksef2"Verify the install
Section titled “Verify the install”import ksef2
print(ksef2.__version__)print(ksef2.Client)print(ksef2.AsyncClient)