Skip to main content

ticket_decoder

Optional arguments for instance creation of DecoderFacade.

  • uic_public_key_xml_file = "cert/UIC_PublicKeys.xml"
    Relative path to the XML file containing UIC public keys you can obtain here: https://railpublickey.uic.org/ .
  • vdv_certificate_ldif_file = "cert/VDV_Certificates.ldif"
    Relative path to the LDIF file containing VDV certificates to decrypt VDV barcode content.
  • fail_on_decoder_error = false
    Fail when the aztec/barcode decoder gets an error if true or deliver an empty result when false.
  • fail_on_interpreter_error = false
    Fail when the interpretation of the data gets an error if true or deliver an empty result when false.

Provided python API is in an early state and the class DecoderFacade supports 3 methods right now only.

  • decode_bytes('...')

  • decode_base64('...') is considered for the use case you decode the raw data from aztec-code in advance via zxing-cpp or other aztec-code-decoding library of your choice and you want to decode raw train ticket barcode data to json only. In this case, be careful with the output of the decoder to avoid string encodings like UTF8 or other multi-byte encodings. Ideally try to get access to the raw byte array and just encode those bytes to base64 before passing it to the method. If your aztec-code-decoder provides a string-type only and you are able to pass a character-encoding option, try using 'ISO 8859-1' and cast the result string to raw bytes.

  • decode_files('...') detects and decodes aztec-codes from file or directories (PDF, image) and decodes barcode data to json. This is using zxing-cpp and opencv internally. It returns a dict (origin/input-path and json-string) of size x, while x is the amount of aztec-codes found on input. An image can contain always multiple barcodes, the return value is alway a mapping of origin to json content.

    • rotation_degree - Rotate image before processing for the given amount of degrees (default 0)
    • scale_percent - Scale image before processing in percent (default 100)
    • splitting_mode - Split image, 1st number specifies the no of parts to split, 2nd is the part used for processing, clockwise from top/left (default 11)
    • flipping_mode - Flip image around X if 1, around Y if 2, and around X and Y if 3 (default 0)

Example decoding directly from PDF or image

from ticket_decoder import DecoderFacade

decoder_facade = DecoderFacade()
print(decoder_facade.decode_files('path/2/your/ticket.pdf'))

Example decoding Aztec-Code in advance using zxingcpp and opencv on Python side

from ticket_decoder import DecoderFacade
from zxingcpp import read_barcodes
from cv2 import imread

image = imread('path/2/your/ticket.jpg')
if image is None:
    print("Image not found")
    exit(1)

barcodes = read_barcodes(image)
if barcodes is None:
    print("No barcodes found")
    exit(1)

decoder_facade = DecoderFacade(\
    uic_public_key_xml_file = "cert/UIC_PublicKeys.xml",\
    vdv_certificate_ldif_file = "cert/VDV_Certificates.ldif")

print(decoder_facade.decode_bytes(barcodes[0].bytes))

Metadata

Release files for ticket-decoder 0.20.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ticket-decoder 0.20.3
File Size Uploaded
ticket_decoder-0.20.3.tar.gz 1.7 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for ticket-decoder 0.20.3
File
ticket_decoder-0.20.3-cp314-cp314-manylinux_2_34_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.34+ x86-64 Details
ticket_decoder-0.20.3-cp314-cp314-manylinux_2_34_aarch64.whl CPython 3.14 CPython 3.14 Linux glibc 2.34+ ARM64 Details
ticket_decoder-0.20.3-cp314-cp314-macosx_11_0_arm64.whl CPython 3.14 CPython 3.14 macOS 11.0+ ARM64 Details
ticket_decoder-0.20.3-cp314-cp314-macosx_10_15_x86_64.whl CPython 3.14 CPython 3.14 macOS 10.15+ x86-64 Details
ticket_decoder-0.20.3-cp313-cp313-manylinux_2_34_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.34+ x86-64 Details
ticket_decoder-0.20.3-cp313-cp313-manylinux_2_34_aarch64.whl CPython 3.13 CPython 3.13 Linux glibc 2.34+ ARM64 Details
ticket_decoder-0.20.3-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
ticket_decoder-0.20.3-cp313-cp313-macosx_10_15_x86_64.whl CPython 3.13 CPython 3.13 macOS 10.15+ x86-64 Details

Total release size: 84.1 MB

Release files / ticket_decoder-0.20.3.tar.gz

Download URL ticket_decoder-0.20.3.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
67bbb827418b88d384cb839f151d327eeb9a3540deb30f9602159d460905b1da
BLAKE2b-256 checksum
How to use checksums
47d09995af8f22d71dd053f07f1346cfcd8ca10903f7c0b1781b777e97a44acf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 4, 2026.

Transparency log

Release files / ticket_decoder-0.20.3-cp314-cp314-manylinux_2_34_x86_64.whl

Download URL ticket_decoder-0.20.3-cp314-cp314-manylinux_2_34_x86_64.whl
Size 12.3 MB
Tags CPython 3.14 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
4bb99dd35211141e2d5c93263e8510ed47397c18404853cb516ddbe70f2e3eca
BLAKE2b-256 checksum
How to use checksums
8e55229287c8156e98c61f9cae77bea22c50b58e6233f5aa0e134463fb568180
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 4, 2026.

Transparency log

Release files / ticket_decoder-0.20.3-cp314-cp314-manylinux_2_34_aarch64.whl

Download URL ticket_decoder-0.20.3-cp314-cp314-manylinux_2_34_aarch64.whl
Size 11.0 MB
Tags CPython 3.14 Linux glibc 2.34+ ARM64
SHA-256 checksum
How to use checksums
c094068e37903a3a43b270aaf7edf32b212afd1f20f6154404f30ecae58eea1a
BLAKE2b-256 checksum
How to use checksums
fcca3ddb7672d0167056026f009484b11f1993d0657db07da6a8e49d765c258f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 4, 2026.

Transparency log

Release files / ticket_decoder-0.20.3-cp314-cp314-macosx_11_0_arm64.whl

Download URL ticket_decoder-0.20.3-cp314-cp314-macosx_11_0_arm64.whl
Size 8.2 MB
Tags CPython 3.14 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c95b18a637c213883698780e8f354689676f21a828868fb15722dffb38639490
BLAKE2b-256 checksum
How to use checksums
4214ee0cf063f1c1bff33949cd1d957db6e969beaad3f655c954ae72088e8e07
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 4, 2026.

Transparency log

Release files / ticket_decoder-0.20.3-cp314-cp314-macosx_10_15_x86_64.whl

Download URL ticket_decoder-0.20.3-cp314-cp314-macosx_10_15_x86_64.whl
Size 9.7 MB
Tags CPython 3.14 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
a9a443b88c0eb51dc07f8f37d7bb517437fe03d2f3181229a170fbd6c88d8a91
BLAKE2b-256 checksum
How to use checksums
609fd1b4396d7064f1ad38107081df9de03e4ad87da6e6a7404fedd96a50d84a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 4, 2026.

Transparency log

Release files / ticket_decoder-0.20.3-cp313-cp313-manylinux_2_34_x86_64.whl

Download URL ticket_decoder-0.20.3-cp313-cp313-manylinux_2_34_x86_64.whl
Size 12.3 MB
Tags CPython 3.13 Linux glibc 2.34+ x86-64
SHA-256 checksum
How to use checksums
ac89ed9a976b8e74d74dba5ed48cc303630081933672a3369863c287f809dfea
BLAKE2b-256 checksum
How to use checksums
c351125d2c39941fabd7931f1ae932e5c35acf3f6be256fa1cf717d91e7666fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 4, 2026.

Transparency log

Release files / ticket_decoder-0.20.3-cp313-cp313-manylinux_2_34_aarch64.whl

Download URL ticket_decoder-0.20.3-cp313-cp313-manylinux_2_34_aarch64.whl
Size 11.0 MB
Tags CPython 3.13 Linux glibc 2.34+ ARM64
SHA-256 checksum
How to use checksums
b08bba6f8f513caad5e600d7ade3d72e4fe063f117a0d1d2958f4c65bdb4898b
BLAKE2b-256 checksum
How to use checksums
a1a4de67866b71e6bcb025fd8b09449893eb2b325b437686a97a03f4cef077e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 4, 2026.

Transparency log

Release files / ticket_decoder-0.20.3-cp313-cp313-macosx_11_0_arm64.whl

Download URL ticket_decoder-0.20.3-cp313-cp313-macosx_11_0_arm64.whl
Size 8.2 MB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
8203e34fe13cf414c3673bc606d408920a05484a62e67710b95f3553556b2e22
BLAKE2b-256 checksum
How to use checksums
2333ad47a196d36dfbcca782f04073d87e4c26de48b1340f30de2ac2d5ee3177
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 4, 2026.

Transparency log

Release files / ticket_decoder-0.20.3-cp313-cp313-macosx_10_15_x86_64.whl

Download URL ticket_decoder-0.20.3-cp313-cp313-macosx_10_15_x86_64.whl
Size 9.7 MB
Tags CPython 3.13 macOS 10.15+ x86-64
SHA-256 checksum
How to use checksums
c8911bf24234cfb19ca822c54ac1fb073ac1555485d7eae5ff97a3a52cdcb3b1
BLAKE2b-256 checksum
How to use checksums
fb4173fb1293f4dd7369a7955b1b5b44b6368992de5ececec099dcaf63faa260
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 4, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.20.3 This release

9 release files

0.20.2

7 release files

0.20.1

7 release files

0.20.0

7 release files

0.19

7 release files

0.18

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page