Multidecoder
Automatically attempt to (recursively) decode text using common encodings.
Supported encodings
- base64 (and its urlsafe variant)
- hexadecimal
- html escape characters
- url encoding
Supported unicode encodings
Via chardet:
- ASCII, UTF-8, UTF-16 (2 variants), UTF-32 (4 variants)
- Big5, GB2312, EUC-TW, HZ-GB-2312, ISO-2022-CN (Traditional and Simplified Chinese)
- EUC-JP, SHIFT_JIS, CP932, ISO-2022-JP (Japanese)
- EUC-KR, ISO-2022-KR, Johab (Korean)
- KOI8-R, MacCyrillic, IBM855, IBM866, ISO-8859-5, windows-1251 (Cyrillic)
- ISO-8859-5, windows-1251 (Bulgarian)
- ISO-8859-1, windows-1252, MacRoman (Western European languages)
- ISO-8859-7, windows-1253 (Greek)
- ISO-8859-8, windows-1255 (Visual and Logical Hebrew)
- TIS-620 (Thai)
Install
The recommended way to install this is via pipx:
pipx install text-multidecoder
Or from git:
pipx install git+https://github.com/rshk/multidecoder.git@main
Or run from a source code checkout:
git clone https://github.com/rshk/multidecoder.git
cd ./multidecoder
uv sync
uv run multidecoder
Install via pip:
pip install text-multidecoder
Add to your uv project as a dependency:
uv add text-multidecoder
Command-line usage
multidecoder -t "string to decode"
multidecoder < decodeme.txt
Library usage
from multidecoder import multidecode, display_result
results = multidecode(text, max_depth=10)
display_result(results, sys.stdout)
Contributing
Just open an issue or pull request on gituhb.
If your're contributing a decoder, place short ones (max 10 lines or
so) inside the basic module. Longer ones should be placed in their
own module.
Decoders carrying extra dependencies should probably be made optional, and possibly installed as "extras". Support for optional decoders is not implemented yet, but please do reach out if this is something you might need.
Metadata
Release files for text-multidecoder 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| text_multidecoder-0.1.1.tar.gz | 6.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| text_multidecoder-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.6 kB
Release files / text_multidecoder-0.1.1.tar.gz
| Download URL | text_multidecoder-0.1.1.tar.gz |
|---|---|
| Size | 6.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
47dfe2c6f0047299e5041941291deb403d0fbbbe6697eb1cfd4acb5ff0ad771b
|
|
BLAKE2b-256 checksum How to use checksums |
1bda90eab023a35e93cdec02cb00330fa153765b89f57936ec28376c5ccf00cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.15
|
Release files / text_multidecoder-0.1.1-py3-none-any.whl
| Download URL | text_multidecoder-0.1.1-py3-none-any.whl |
|---|---|
| Size | 7.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3571313511f5f8913b955cb2e8351fb9f2233ea5095b9ad6212f3fd2d7e9f50a
|
|
BLAKE2b-256 checksum How to use checksums |
c90a12021d8938febe41721ee3848372ce4054586bc815b751c99824f2799fcc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.8.15
|