bitjet
Binary data visualization as a Jupyter anywidget. Drop bytes in, see structure come out.
from bitjet import BitView, ByteView
BitView(data=open("/bin/ls", "rb").read(), datawidth=64)
What it does
Every bit (or byte) in your payload becomes a fixed-size block on a canvas. The datawidth slider changes how many units are drawn per row — not how big the canvas gets — so periodic structures in the data (byte boundaries in ASCII text, alignment padding, null runs in executables, LZ-compressed block headers) line up into columns and patterns pop out as you drag.
Install
pip install bitjet
That's it. anywidget handles the JS — no lab extension, no server extension, no rebuild step.
Use
from bitjet import BitView, ByteView
# Bit mode: each bit is a white (1) or black (0) block. Good for ASCII text,
# checksums, bitfields, anywhere the individual bits matter.
BitView(data=b"The quick brown fox jumps over the lazy dog. " * 128, datawidth=64)
# Byte mode: each byte is a grayscale block (0=black, 255=white). Good for
# pixel data, pickled objects, compressed blobs, anything where byte-level
# entropy matters.
ByteView(data=bytes(range(256)) * 16, datawidth=32, block_size=6)
Assign to data to live-update:
import os
view = BitView(data=b"")
view # renders
# In a later cell
view.data = os.urandom(8192)
Traitlets
| trait | type | default | meaning |
|---|---|---|---|
data |
bytes |
b"" |
The binary payload. Accepts bytes, bytearray, memoryview, or anything with .tobytes() (e.g. numpy.ndarray). |
datawidth |
int |
64 |
Units per row. Bits if mode == "bit", bytes if mode == "byte". |
block_size |
int |
4 |
Pixel side length of each unit. Fixed across widths so patterns scale. |
mode |
"bit" or "byte" |
"bit" |
Rendering mode. |
All sync bidirectionally. Drag the slider and the Python side sees the update; assign view.datawidth = 128 and the canvas redraws.
Compatible with
- JupyterLab 3+
- Jupyter Notebook 7+
- VS Code notebooks
- nteract desktop (tested during development)
- Anything else that runs anywidget
History
Replaces the original 2014-era bitjet that depended on ipywidgets 1.x-style nbextensions. Same idea, modern plumbing — anywidget loads the ESM directly instead of requiring a notebook extension install.
License
BSD-3-Clause. See LICENSE.
Metadata
Release files for bitjet 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bitjet-1.0.0.tar.gz | 5.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bitjet-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.4 kB
Release files / bitjet-1.0.0.tar.gz
| Download URL | bitjet-1.0.0.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f10ac05696af261fb6a2bb9c87423f8f4794bda82d202898b4ac133ccec0c68f
|
|
BLAKE2b-256 checksum How to use checksums |
2492f5d6afa47b55f0b52184b6b1060f273005c02691857c6713a4299276c533
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Release files / bitjet-1.0.0-py3-none-any.whl
| Download URL | bitjet-1.0.0-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
be850ad58dbfa94c79696c91a9778b708bdc613da08e1f7020b6e31adb852dc7
|
|
BLAKE2b-256 checksum How to use checksums |
854c95d63a1afbc6b3527c64f287344d3429769d4cc22ff3f5b61f55fd64aa77
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|