Python EET API
Simple to use and mostly secure (mainly pedantic) API for Czech EET Gate.
Installation
pip install czech-eet
Usage
Basic usage with single request
from eet import invoices, helpers
cert_text = b'''
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
'''
key_text = b'''
-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----
'''
# prepare certificate and private key
cert = helpers.parse_cert(cert_text)
pk = helpers.parse_key(key_text)
# create config
config = invoices.Config(cert, pk, 141, "1patro-vpravo")
# create factory using config
factory = invoices.Factory(config)
# build new invoice & send
invoice = factory.new("141-18543-05", 236.00, zakl_dan1=100.0, dan1=21.0)
response = invoice.send()
# note: if resending, you should set `eet.invoice.Hlavicka["prvni_zaslani"] = eet.types.boolean(False)`
# or use scheduler ;-)
# now validate response and get fik
codes = response.codes()
if response:
print("BKP: {0}\nFIK: {1}".format(codes.bkp, codes.fik))
else:
print("BKP: {0}\nPKP: {1}".format(codes.bkp, codes.pkp))
print("Errors:", response.Chyba, response.Varovani)
Example of scheduler
from eet import invoices, helpers, remote
... # prepare invoice as before
# create instance of scheduler
scheduler = remote.Scheduler()
# same as before but now you can resend invoices
response = scheduler.process(invoice)
# call dispatch is reasonable time interval from your mainloop
import time
while True:
scheduler.dispatch()
time.sleep(60)
Metadata
Release files for czech-eet 1.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| czech-eet-1.0.5.tar.gz | 8.0 kB | Without provenance | Details for czech-eet-1.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| czech_eet-1.0.5-py3-none-any.whl | Python 3 | none | any | Details for czech_eet-1.0.5-py3-none-any.whl |
Total release size: 19.1 kB
Release files / czech-eet-1.0.5.tar.gz
| Download URL | czech-eet-1.0.5.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
da1d3e00541f7904e0bf80743df74dd0d166d2acc5325ddd426915c01293d89e
|
|
BLAKE2b-256 checksum How to use checksums |
beb9096e6f34803df2308bc6a4cd108da4b78b38c2b10dba6ace9f26e2685902
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.1
|
Release files / czech_eet-1.0.5-py3-none-any.whl
| Download URL | czech_eet-1.0.5-py3-none-any.whl |
|---|---|
| Size | 11.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f68fedd5d0e275a9433b36c50432f50d9762b8476c171f44743efc1c2794b3df
|
|
BLAKE2b-256 checksum How to use checksums |
880aa8e13e292d187efc5c2adccab5419465deac02ec5abe176ffba9159138d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.42.0 CPython/3.7.1
|
Security for czech-eet 1.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.