etl_codes.py¶
-
class
etl_codes.
ETLCodes
(euc_co59_file_path: str)¶ A convenience class for using all codecs which are used in the ETL data set.
Warning
The ‘euc_co59.dat’-file from the ETL data set is required in the data set directory.
-
T56
(c: int) → str¶ Decodes c into a string using the T56-code.
- Parameters
c – An integer which should be decoded using the T56-code.
- Returns
The decoded str.
-
co59_to_utf8
(co59) → str¶ Decodes co59 to utf-8.
- Parameters
co59 – The string which should be decoded from co59 to utf-8.
- Returns
The decoded utf-8 string
-
decode_8B_type_character
(_bytes: bytes) → str¶ Decodes _bytes which encode the label from an entry which has the ETL-8B type.
- Parameters
_bytes – The bytes object which should be decoded.
- Returns
The decoded label.
-
decode_8G_type_character
(_bytes: bytes) → str¶ Decodes _bytes which encode the label from an entry which has the ETL-8G type.
- Parameters
_bytes – The bytes object which should be decoded.
- Returns
The decoded label.
-
decode_9B_type_character
(_bytes: bytes) → str¶ Decodes _bytes which encode the label from an entry which has the ETL-9B type.
- Parameters
_bytes – The bytes object which should be decoded.
- Returns
The decoded label.
-
decode_9G_type_character
(_bytes: bytes) → str¶ Decodes _bytes which encode the label from an entry which has the ETL-9G type.
- Parameters
_bytes – The bytes object which should be decoded.
- Returns
The decoded label.
-
decode_C_type_character
(_bytes: bytes, char_code) → str¶ Decodes _bytes which encode the label from an entry which has the ETL-C type.
- Parameters
_bytes – The bytes object which should be decoded.
char_code – The T56 code of the entry.
- Returns
[description]
-
decode_K_type_character
(_bytes: bytes) → str¶ Decodes _bytes which encode the label from an entry which has the ETL-K type.
- Parameters
_bytes – The bytes object which should be decoded.
- Returns
The decoded label.
-
decode_M_type_character
(_bytes: bytes) → str¶ Decodes _bytes which encode the label from an entry which has the ETL-M type.
- Parameters
_bytes – The bytes object which should be decoded.
- Returns
The decoded label.
-
init_co59
(euc_co59_file_path: str)¶ Initialize reading of “co59”-codes
-
init_codes
()¶ Setup a dict which contains ETLDataSetInfo-instances with the necessary info about the data set types.
-