Registry / serialization / t61codec

t61codec

JSON →
library2.0.0pypypi✓ verified 85d ago

t61codec is a Python library that provides a codec for handling ITU T.61 character strings. It allows encoding Python strings into T.61 byte sequences and decoding T.61 byte sequences back into Python strings. The current version is 2.0.0 and it maintains a semantic versioning release cadence, though updates are infrequent.

pip install t61codec
INSTALL
IMPORT
SIG · T61CODEC
T
t61codec
serializationpythonv2.0.0
Install
1.5s avg
Import
102ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.108s · 17.8MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 1.5s · import 0.097s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

t61codec
import t61codec t61codec.register()
import codecs codecs.encode('hello', 't.61')
The 't.61' codec is not available by default in the standard 'codecs' module until `t61codec.register()` is explicitly called.

This quickstart demonstrates how to register the t61codec and then use Python's built-in `codecs` module to encode and decode strings using the 't.61' encoding.

import t61codec import codecs t61codec.register() # Encode a Python string to T.61 bytes python_string = "Hello, World!" t61_bytes = codecs.encode(python_string, 't.61') print(f"Encoded: {t61_bytes!r}") # Decode T.61 bytes back to a Python string decoded_string = codecs.decode(t61_bytes, 't.61') print(f"Decoded: {decoded_string}") # Example with characters that might be specific to T.61 (if applicable) # For simplicity, using basic ASCII characters as T.61 is an 8-bit encoding # For specific non-ASCII T.61 characters, consult ITU-T T.61 standard.
Debug
Known issues
gotchaThe `t.61` codec must be explicitly registered with Python's `codecs` registry before it can be used. Forgetting to call `t61codec.register()` will result in a `LookupError` when trying to use the 't.61' encoding.
fix
Always call `t61codec.register()` once at the start of your application or before the first use of the 't.61' encoding.
affects: All versions
gotchaITU T.61 is an 8-bit encoding. While it can represent some non-ASCII characters, it has a limited character set compared to modern encodings like UTF-8. Attempting to encode characters not supported by T.61 will raise a `UnicodeEncodeError`.
fix
Ensure that input strings only contain characters representable in T.61 or implement appropriate error handling (e.g., `'replace'`, `'ignore'`) when encoding.
affects: All versions
Errors
Common errors & fixes
LookupError: unknown encoding: t.61
The `t61codec` library has not been registered with Python's `codecs` module.
fix
Add `t61codec.register()` at the beginning of your script or before attempting to use the 't.61' encoding.
UnicodeEncodeError: 't.61' codec can't encode character '\u20ac' in position X: character maps to <undefined>
The input string contains a Unicode character (e.g., Euro sign '€') that is not supported by the ITU T.61 encoding.
fix
Filter out or replace unsupported characters before encoding, or specify an error handler like `errors='replace'` or `errors='ignore'` in the `encode` call (e.g., `codecs.encode(my_string, 't.61', errors='replace')`).
Upgrade
Version history
2.0.0latest on PyPI · released Oct 19, 2020
Audit
Dependencies

No dependency data recorded yet.

Agent activity
8 hits · last 30 days
node
6
OpenAI (training)
1
Resources
t61codec — pip install t61codec · libregistry