A library to check for existing obligations from KAT Bulgaria
Project description
Summary
This library allows you to check if you have fines from KAT Bulgaria programatically.
The code here is a simple wrapper around the API, providing you with error validation and type safety.
It does NOT save or log your data anywhere and it works with a single API endpoint.
The reason this library is needed is because the government website is highly unstable and often throws random errors and Timeouts. This library handles all known bad responses (as of the time of writing) and provides a meaningful error message and an error code for every request.
If you like my work, please consider donating
Installation
pip install kat_bulgaria
Example usage script:
For a full working sample usage script, check out sample_usage_script.py.
Remember to replace the dummy data in the constants with your own data.
# Проверка за физически лица - лична карта:
obligations = await KatApiClient().get_obligations_individual(
egn="валидно_егн",
identifier_type=PersonalDocumentType.NATIONAL_ID,
identifier="номер_лична_карта"
)
print(f"Брой задължения - ФЛ/ЛК: {len(obligations)}\n")
print(f"Raw JSON: {obligations}\n")
# Проверка за физически лица - шофьорска книжка:
obligations = await KatApiClient().get_obligations_individual(
egn="валидно_егн",
identifier_type=PersonalDocumentType.DRIVING_LICENSE,
identifier="номер_шофьорска_книжка"
)
print(f"Брой задължения - ФЛ/ШК: {len(obligations)}\n")
print(f"Raw JSON: {obligations}\n")
# Проверка за юридически лица - лична карта:
obligations = await KatApiClient().get_obligations_business(
egn="валидно_егн",
govt_id="номер_лична_карта",
bulstat="валиден_булстат"
)
print(f"Брой задължения - ЮЛ: {len(obligations)}\n")
print(f"Raw JSON: {obligations}\n")
Known raw API responses:
You can find sample API responses in /tests/fixtures.
I also document all sample responses in this issue for clarity.
If you have any fines, I would appreciate it if you attach the full JSON API response as a comment to the issue above.
You can get it by copying the url below and replacing EGN_GOES_HERE and LICENSE_GOES_HERE with your own data, then loading it in a browser.
After that place the JSON in any text editor and remove personal data, but do not change the JSON structure itself.
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 kat_bulgaria-3.0.0b4.tar.gz.
File metadata
- Download URL: kat_bulgaria-3.0.0b4.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a9423f226f16f7126d93ef86077136eb09199497068aff94ef47dfd8ff1a737
|
|
| MD5 |
cd263d8a671bb3193826c9669b25ba04
|
|
| BLAKE2b-256 |
853d8d4801e67000d2efa1ce52ef116d1561935eedcec94776d769963837cbd5
|
Provenance
The following attestation bundles were made for kat_bulgaria-3.0.0b4.tar.gz:
Publisher:
on-release-publish.yml on Nedevski/py_kat_bulgaria
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kat_bulgaria-3.0.0b4.tar.gz -
Subject digest:
2a9423f226f16f7126d93ef86077136eb09199497068aff94ef47dfd8ff1a737 - Sigstore transparency entry: 193717525
- Sigstore integration time:
-
Permalink:
Nedevski/py_kat_bulgaria@535efed4ef882be4649a1778a692667a94377437 -
Branch / Tag:
refs/tags/v3.0.0b4 - Owner: https://github.com/Nedevski
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
on-release-publish.yml@535efed4ef882be4649a1778a692667a94377437 -
Trigger Event:
release
-
Statement type:
File details
Details for the file kat_bulgaria-3.0.0b4-py3-none-any.whl.
File metadata
- Download URL: kat_bulgaria-3.0.0b4-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b2cde911b656c7fddd8814fde6145d300a85a00bae53cd89cac6e8199ec44a4
|
|
| MD5 |
10b9652379734df2de73455d31368112
|
|
| BLAKE2b-256 |
da79f647375cd25b9bf83ee049ea2197d590382b5f429bd1f268183f20fdb0a3
|
Provenance
The following attestation bundles were made for kat_bulgaria-3.0.0b4-py3-none-any.whl:
Publisher:
on-release-publish.yml on Nedevski/py_kat_bulgaria
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kat_bulgaria-3.0.0b4-py3-none-any.whl -
Subject digest:
2b2cde911b656c7fddd8814fde6145d300a85a00bae53cd89cac6e8199ec44a4 - Sigstore transparency entry: 193717527
- Sigstore integration time:
-
Permalink:
Nedevski/py_kat_bulgaria@535efed4ef882be4649a1778a692667a94377437 -
Branch / Tag:
refs/tags/v3.0.0b4 - Owner: https://github.com/Nedevski
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
on-release-publish.yml@535efed4ef882be4649a1778a692667a94377437 -
Trigger Event:
release
-
Statement type: