Skip to main content

Client SDK for KSeF API v2

Project description

KSeF Client Python

ksef-client-python jest repozytorium biblioteki (SDK) publikowanej na PyPI jako: ksef-client.

Dokumentacja SDK (kanonicznie w repozytorium): https://github.com/smekcio/ksef-client-python/blob/main/docs/README.md

Zakres

  • Klienci API (KsefClient, AsyncKsefClient) mapujący wywołania na endpointy KSeF.
  • Warstwa workflow (ksef_client.services.workflows) porządkująca scenariusze (uwierzytelnianie, sesje online/batch, eksport).
  • Narzędzia kryptograficzne i pomocnicze (AES/ZIP/Base64Url, linki weryfikacyjne, QR).
  • Uwierzytelnianie tokenem KSeF oraz podpisem XAdES (w tym XadesKeyPair dla PKCS#12 lub zestawu PEM+hasło).

Zachowania protokołu (m.in. pre-signed URL bez nagłówka Authorization, obsługa Retry-After dla 429) są opisane w dokumentacji i odwzorowane w modelach wyjątków.

Wymagania

  • Python >= 3.10

Instalacja (PyPI)

pip install ksef-client

Opcjonalne dodatki (extras):

pip install "ksef-client[xml,qr]"
  • xml – podpis XAdES (lxml, xmlsec)
  • qr – generowanie PNG z kodami QR (qrcode, pillow)

Instalacja (developerska, lokalnie)

pip install -e .

Dokumentacja

Dokumentacja pakietu znajduje się w katalogu docs/:

  • Indeks: https://github.com/smekcio/ksef-client-python/blob/main/docs/README.md
  • Start: https://github.com/smekcio/ksef-client-python/blob/main/docs/getting-started.md
  • Konfiguracja: https://github.com/smekcio/ksef-client-python/blob/main/docs/configuration.md
  • Błędy i retry: https://github.com/smekcio/ksef-client-python/blob/main/docs/errors.md
  • API (endpointy): https://github.com/smekcio/ksef-client-python/blob/main/docs/api/README.md
  • Workflows: https://github.com/smekcio/ksef-client-python/blob/main/docs/workflows/README.md
  • Usługi: https://github.com/smekcio/ksef-client-python/blob/main/docs/services/README.md
  • Utils: https://github.com/smekcio/ksef-client-python/blob/main/docs/utils/README.md
  • Przykłady (skrypty): https://github.com/smekcio/ksef-client-python/blob/main/docs/examples/README.md

Narzędzia developerskie

  • tools/generate_openapi_models.py – generacja src/ksef_client/openapi_models.py na podstawie ksef-docs/open-api.json.
  • tools/lint.py – lokalny runner jakości (m.in. compileall, pip check, opcjonalnie ruff i mypy).

Testy

pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ksef_client-0.2.0.tar.gz (57.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ksef_client-0.2.0-py3-none-any.whl (47.3 kB view details)

Uploaded Python 3

File details

Details for the file ksef_client-0.2.0.tar.gz.

File metadata

  • Download URL: ksef_client-0.2.0.tar.gz
  • Upload date:
  • Size: 57.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ksef_client-0.2.0.tar.gz
Algorithm Hash digest
SHA256 b2a53c9bd0f5b1b0c19c7b5c23be966e62a95e12971f4396ef8fcaf0c9c06a93
MD5 04c58513a18bdaf812e782e14d67586d
BLAKE2b-256 c4352c0d32ed7ec8e950dab162a034e103a25ff279d8b4426d920057d097bed5

See more details on using hashes here.

Provenance

The following attestation bundles were made for ksef_client-0.2.0.tar.gz:

Publisher: publish-pypi.yml on smekcio/ksef-client-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ksef_client-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: ksef_client-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 47.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ksef_client-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 87c4419f00e57209dacd0699f9d1d30236c58d26f1933787d7fc29968a73a150
MD5 1868373518205174238613a3935d8d04
BLAKE2b-256 54d94c10bd719827f05c15d8795fd7cce245f5f09f5ba49e9bc4d795940c1477

See more details on using hashes here.

Provenance

The following attestation bundles were made for ksef_client-0.2.0-py3-none-any.whl:

Publisher: publish-pypi.yml on smekcio/ksef-client-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page