A Python dict that handles TLV decode/encode, very useful for EMV Data.
Project description
TLV - Type/Tag Length Format
Simple class that supports TLV encoding/decoding.
Installation
pip install tlvdict
Simple to use!
>>> from tlvdict import TLVDict
>>> tlv = TLVDict.FromDict({"5F25": "200531", "9F06": "A0000000041010"})
>>> tlv
TLVDict([('5F25', '200531'), ('9F06', 'A0000000041010')])
>>> tlv.build()
'5F25032005319F0607A0000000041010'
>>> tlv2 = TLVDict.FromHex("5F25032005319F0607A0000000041010")
>>> tlv2
TLVDict([('5f25', '200531'), ('9f06', 'A0000000041010')])
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
tlvdict-1.2.0.tar.gz
(7.2 kB
view hashes)