Skip to main content

Recursively attempt to decode text

Project description

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

TODO: install via pipx (as a tool) or pip/uv (as a library)

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

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

text_multidecoder-0.1.0.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

text_multidecoder-0.1.0-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file text_multidecoder-0.1.0.tar.gz.

File metadata

  • Download URL: text_multidecoder-0.1.0.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.15

File hashes

Hashes for text_multidecoder-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e98883e62788464d6449cfd5cc284971b1b4b0dd056426bc5c74ac7ad5e843fb
MD5 e7123bb86bad0aea150e8b2a26952180
BLAKE2b-256 4da42019c3fa7b0eaf823ea16d13f44bfc094364f3aa584aeadbe069de8b0eb0

See more details on using hashes here.

File details

Details for the file text_multidecoder-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for text_multidecoder-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0bddf64fbb579509a79d9800faf499e8f1494e0e23477b9e5bce2c5fe3f35c05
MD5 3555c174e7d984e342e5f154f9dd3483
BLAKE2b-256 371fd66c88d1c5bc8a75082d49e5bb7753611bb7a422fe539d45937fb686e23a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page