Skip to main content

Convert binary files to signed JSON and back, with zstd compression.

Project description

tzBJC - TaggedZ's Binary to JSON Converter

tzBJC is a utility for encoding and decoding binary files to signed JSON format with Zstandard compression. It provides both a command-line interface (CLI) and a graphical user interface (GUI) built with PySide6.


✨ Features

  • 🔐 Encodes binary files into signed JSON format
  • 🔌 Library for easy integration into other projects
  • 🧩 Uses Zstandard compression with Base64 URL-safe encoding
  • 📦 CLI and GUI support
  • ✅ Stream-based processing for large files
  • 📋 Clipboard-friendly JSON output (via GUI)
  • 🧪 Thorough test coverage with Pytest and Pytest-Qt

The Process

[Original Binary File]
        |
        |  (1. Read binary content)
        v
[SHA-256 Digest (hex string)]
        |
        |  (2. Compute SHA-256)
        v
[Binary Content]
        |
        |  (3. Compress using Zstandard)
        v
[Compressed Binary Content]
        |
        |  (4. Encode with base64-url-safe)
        v
      [JSON File | stdout | StringIO | Clipboard-friendly JSON format (GUI)]
        {
          "filename": "example.bin",
          "data": "<bas64-url-safe string of compressed data>",
          "sha256": "<hash of original data>"
        }

--- Later ---

      [JSON File]
        |
        |  (5. Extract compressed base64 + hash)
        v
[Base64-url-safe String]
        |
        |  (6. Decode base64-url-safe)
        v
[Compressed Data]
        |
        |  (7. Decompress with Zstandard)
        v
       [Valid?]
        |
        |  (8. Verify checksum)
        v
[Original Binary Data]
        |
        |  (9. Write to output path)
        v
[Restored Binary File]

📦 Installation

pip install tzBJC

Or from source:

git clone https://github.com/taggedzi/tzBJC.git
cd tzBJC
pip install .

🖥️ Command Line Usage

See CLI help:

tzBJC-cli --help

Encode example:

tzBJC-cli encode -i input.bin -o output.json

Decode example:

tzBJC-cli decode -i output.json -o restored.bin

🪟 GUI Usage

tzBJC-gui

Drag-and-drop or select binary or JSON files to convert between formats. The GUI supports:

  • File output
  • Clipboard-friendly output
  • Overwrite protection (with force option)

🛠 Developer Instructions

Set up a local development environment:

git clone https://github.com/taggedzi/tzBJC.git
cd tzBJC
python -m venv .venv
source .venv/bin/activate  # on Windows: .venv\Scripts\activate
pip install -e .[dev]

Run tests with coverage:

pytest --cov=src

Build the package:

python -m build

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


🌐 Links

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

tzbjc-0.2.17.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

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

tzbjc-0.2.17-py3-none-any.whl (9.4 kB view details)

Uploaded Python 3

File details

Details for the file tzbjc-0.2.17.tar.gz.

File metadata

  • Download URL: tzbjc-0.2.17.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.17

File hashes

Hashes for tzbjc-0.2.17.tar.gz
Algorithm Hash digest
SHA256 180a2e283d5aaaa8e4ba74857dd8068fad8caa5b46419162c2b95624f0d1814f
MD5 350bd1190e9d575b38b15e20bffd1212
BLAKE2b-256 4f355ec07b0903fb1155882546f0488880b4e403112a8bda19a3c4fb7c86636e

See more details on using hashes here.

File details

Details for the file tzbjc-0.2.17-py3-none-any.whl.

File metadata

  • Download URL: tzbjc-0.2.17-py3-none-any.whl
  • Upload date:
  • Size: 9.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.17

File hashes

Hashes for tzbjc-0.2.17-py3-none-any.whl
Algorithm Hash digest
SHA256 e45562a1c15c279c79a1b41480b4a268cb21fd5e870dd33143cdf94298a87d2d
MD5 c523e8044164b72a28ae58142101f79f
BLAKE2b-256 faf4c1c559d8de9a194b2309277e85ee050fe2833edb5463f066ab7b9d6cb60a

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