This project makes it easier to use the SKAT webservices.
Project description
python-skat-webservice
This Python library is used to call the Danish SKAT eIndkomst SOAP webservice.
https://info.skat.dk/data.aspx?oid=4247
Currently the following services are supported:
- IndkomstOplysningPersonHent
Prerequisites
Service agreement
Before using the webservices you need to setup a service agreement with SKAT.
Read more here: https://info.skat.dk/data.aspx?oid=2248828
In the service agreement you will receive 3 codes that is used when calling the services:
- AbonnentTypeKode
- AbonnementTypeKode
- AdgangFormaalTypeKode
All three codes are numbers 3-5 digits long.
Certificates
The OCES3 P12 certificate you use to register with SKAT needs to be converted to two PEM certificates before being used in the code. You can use openssl for this:
openssl pkcs12 -in Certificate.p12 -out Certificate.crt.pem -clcerts -nokeys
openssl pkcs12 -in Certificate.p12 -out Certificate.key.pem -nocerts -nodes
IndkomstOplysningPersonHent
Usage
The IndkomstOplysningPersonHent allows you to get income information about a single person for a given range of months.
from python_skat_webservice.soap_signer import SOAPSigner
from python_skat_webservice.common import CallerInfo
from python_skat_webservice.indkomst_oplysning_person_hent import search_income
if __name__ == '__main__':
signer = SOAPSigner("something/certifcate.crt.pem", "something/certificate.key.pem")
caller = CallerInfo(
se_number="12345678", # Your company's SE number
abonnent_type_kode="123",
abonnement_type_kode="4567",
adgang_formaal_type_kode="456",
caller_id="My caller id" # Any id to identify you with SKAT. Can be anything.
)
result = search_income(
cpr="1234567890",
month_from="202401", # yyyymm
month_to="202401", # yyyymm
transaction_id="My transaction id", # Any id to identify the transaction. Can be anything.
caller_info=caller,
soap_signer=signer
)
print(result)
Output
The output is a SOAP xml envelope with the search results in the body. The body is structured something like this:
Person
├── Company
│ ├── Period
│ │ ├── Form
│ │ │ ├── Form ID
│ │ │ ├── Field
│ │ │ │ ├── Field ID
│ │ │ │ ├── Type
│ │ │ │ └── Value
│ │ │ └── Field
│ │ │ └── ...
│ │ ├── Form
│ │ │ └── ...
│ │ └── ...
│ └── Period
│ └── ...
└── Company
└── ...
The income information is first grouped by the paying company. Then by period (usually by month). Then in forms (blanket) with fields.
Forms can be layered so a form may contain multiple subforms.
Descriptions of the forms and fields can be found in 'underbilag 1' here: https://info.skat.dk/data.aspx?oid=2248828&chk=220344
Example: The form 16001 field 100000000000000057 is "A-indkomst, hvoraf der betales AM-bidrag".
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file python_skat_webservice-0.1.0.tar.gz.
File metadata
- Download URL: python_skat_webservice-0.1.0.tar.gz
- Upload date:
- Size: 7.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
287d276d3f611b9b7c5db83fb77345c46ee5f87c958f5cdbad2ec2ca2eb8cc78
|
|
| MD5 |
2d11affa3c869a7a5490df63e3980e28
|
|
| BLAKE2b-256 |
c5ec9a60c841ad748c1ef2513508adbaee975bb6a2226f6805eb6928d46bf9e0
|
File details
Details for the file python_skat_webservice-0.1.0-py3-none-any.whl.
File metadata
- Download URL: python_skat_webservice-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.22
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90086ad4a75890df8907fb587316068afa2b1dd84e257da21ee3997be4f73f5d
|
|
| MD5 |
1a7bad9001bb117ef43cfa735df4f60a
|
|
| BLAKE2b-256 |
e9878f4f9cb71323de6199f22255baa5637a2fb2fd50f488fce82f2f6b5ad4e4
|