eet-client
Unofficial Python client for the Czech EET 2.0 sales registration service (evidence tržeb, zákon č. 180/2026 Sb., in force from 1 January 2027).
It builds the message for a sale, signs it with the taxpayer's certificate, sends it to the tax administration and checks the signed confirmation. Storing sales and deciding when to send them again stay in your application.
Neoficiální klient pro EET 2.0 v Pythonu: sestaví a podepíše datovou zprávu evidované tržby, odešle ji a ověří podpis potvrzení. Ukládání tržeb a plánování opakovaného zaslání zůstávají na vaší aplikaci.
Status
Version 0.x. The API may still change, and so may the service: it starts on 1 January 2027. The library is tested against the Playground, the public test environment of the tax administration. The production environment has not been used yet; the name of the certificate that signs its confirmations is taken from the published access document.
Installation
$ python -m pip install eet-client
It needs Python 3.11 or newer and installs cryptography and lxml (and
tzdata on Windows). It also reads the IANA time zone database, which macOS
and most Linux systems have; on a minimal container image install the
system's tzdata package or tzdata from PyPI.
Example
from datetime import datetime
from decimal import Decimal
from zoneinfo import ZoneInfo
from eet_client import PLAYGROUND, Certificate, Client, Rejected, Sale, Unavailable
with open("CA_EET-Playground-CZ00000019.p12", "rb") as file:
certificate = Certificate.from_pkcs12(file.read(), password)
client = Client(certificate, PLAYGROUND, timeout=5.0)
sale = Sale(
eic="CZ00000019",
unit_id=11,
device_id="POS-1",
sequence="2027/0001",
sold_at=datetime(2027, 1, 4, 9, 30, 0, tzinfo=ZoneInfo("Europe/Prague")),
total=Decimal("1500.00"),
)
message = client.build(sale) # signed, not sent yet
# Record message.uuid and message.sent_at now, before anything goes out.
try:
confirmation = client.send(message)
except Unavailable:
... # not confirmed: send the sale again later, as a repeat
except Rejected as error:
... # refused: error.code and error.text say why
else:
confirmation.pok # the confirmation code
confirmation.warnings # what the service found wrong but accepted
The test certificates and their password are published with the other
documents for developers.
For real sales, pass PRODUCTION instead of PLAYGROUND.
The sale
Sale checks every value against the official schema when it is created and
raises ValueError or TypeError for one that does not fit. Nothing is
rounded, cut or guessed:
- amounts are
Decimalwith at most two decimal places; sold_atis timezone-aware and in whole seconds; it is reported as Czech local time whatever zone it is given in;- optional values that do not apply are left out, not set to zero.
A refund is a sale with a negative total, its own sequence and the time of
the refund.
The interface description also requires eic, unit_id, device_id and
sold_at to be unique together, so one device must not report two sales in
the same second. The library keeps no state and cannot check this.
Sending again
send makes one attempt. When it raises Unavailable, the sale may or may not
have been registered, and reporting it again is the right thing to do:
confirmation = client.send(client.build(sale, repeat=True))
- Use
repeat=Truefor every attempt after the first, even if the first one never left the machine. That is why the attempt is recorded beforesend. - Build the repeat from a
Salewith the same values. The service recognizes a sale byeic,unit_id,device_id,sequence,sold_atandtotal, so store them as they were sent. - Each attempt is a new message with its own
uuid, and each confirmation has its ownpok. - When and how often to try again is up to the application. The act asks for it without delay once the cause has passed, and within 48 hours of the sale (§ 20). The duty does not end there: keep trying until a confirmation comes.
Rejected means the service refused the message. error.code is usually one
of the codes in ErrorCode, but the service may add new ones. The same
message would be refused again, so it needs a person.
InvalidReply is a kind of Unavailable: a reply came, but it could not be
read or its signature could not be trusted. Handle it like any Unavailable,
and look into it if it keeps happening.
All three carry transaction_id, the identifier that the service gave to the
exchange, if it answered. Quote it when you ask the tax administration about
a message.
The confirmation
A reply counts as a confirmation only if its signature holds, it answers the
message that was sent, and its signer is the one that the endpoint names: a
certificate of the tax administration issued by I.CA, the authority whose
certificate the library carries. A confirmation that fails one of these
raises InvalidReply.
The service does not sign its error replies or its answers in verification mode, so those are only as trustworthy as the TLS connection they came over.
If the tax administration changes its signing certificate before this library follows, describe the new one yourself. Pass only what has changed:
import dataclasses
endpoint = dataclasses.replace(
PRODUCTION,
signer="...", # common name of the new certificate
authorities="...", # its issuing authority's certificate, as PEM text
)
The time limit
timeout bounds the whole exchange: resolving the name, connecting, the TLS
handshake, sending and reading the reply. It is given in seconds, defaults to
5 and cannot be less than 2, the shortest response limit that the act lets a
taxpayer set (§ 19), or more than 600.
Every call opens a new connection. Proxy settings are not used, redirects are not followed, and the server's certificate is always checked against the system's certificate authorities.
Verification mode
verification = client.verify(sale)
sends the sale in verification mode: the service checks the message and registers nothing. It answers without a signature and without a confirmation code, so the result shows that the message and the certificate are accepted, not that a sale was registered.
Not included
Storing sales and attempts, scheduling repeats, renewing certificates, proxy support, an asynchronous API and a command-line tool.
Contributing
See CONTRIBUTING.md. Security problems are reported privately, see SECURITY.md.
Disclaimer
This is an unofficial project. It is not affiliated with or endorsed by the Czech Financial Administration (Finanční správa České republiky). You remain responsible for meeting your obligations under the act.
License
Metadata
Release files for eet-client 0.1.0
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 |
|---|---|---|---|---|
| eet_client-0.1.0.tar.gz | 26.8 kB | With provenance | Details for eet_client-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| eet_client-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for eet_client-0.1.0-py3-none-any.whl |
Total release size: 55.3 kB
Release files / eet_client-0.1.0.tar.gz
| Download URL | eet_client-0.1.0.tar.gz |
|---|---|
| Size | 26.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f69f322160703599b542ee77f618a8063e53e187b2222d10d849cfc149187a1e
|
|
BLAKE2b-256 checksum How to use checksums |
0586eec7c352546042b5e267bd047ca9b517c5f3c8d263657b02de7a7f207f7f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logRelease files / eet_client-0.1.0-py3-none-any.whl
| Download URL | eet_client-0.1.0-py3-none-any.whl |
|---|---|
| Size | 28.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4641b0468650ffd2e56e362b555a6a26eca02e0ac63fbea4f11ef632c72e149c
|
|
BLAKE2b-256 checksum How to use checksums |
d92f339d761d22c1aee79d2562b4d91ca67e9bd86a450018c4109238b8a6325b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logSecurity for eet-client 0.1.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for eet_client-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.
Transparency logA 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.