Registry / serialization / rabbitizer

rabbitizer

JSON →
library1.16.0pypypi✓ verified 87d ago

Rabbitizer is a MIPS instruction decoder library for Python (and Rust/C) that supports multiple MIPS ISAs including R3000GTE, R4000Allegrex, R5900EE, and more. Current version is 1.16.0, with a 2.0.0-alpha series in development. It is used primarily in decompilation toolchains like Decompollaborate's tools. Release cadence is irregular, roughly monthly.

pip install rabbitizer
INSTALL
IMPORT
SIG · RABBITIZER
R
rabbitizer
serializationpythonv1.16.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

Instruction
✓ from rabbitizer import Instruction
✗ from rabbitizer.instruction import Instruction
The main classes are in the top-level package, not submodules.
RabbitizerConfig
✓ from rabbitizer import RabbitizerConfig

Basic usage: create an Instruction from a 32-bit word, then access its properties.

from rabbitizer import Instruction, RabbitizerConfig # Decode a MIPS instruction from its hex word word = 0x0C000000 # jal 0x0 instr = Instruction(word) print(instr.mnemonic()) # jal print(instr.opcode().name()) # jal print(instr.arguments()) # list of arguments # Access register names print(instr.rs.name()) # $zero print(instr.rt.name()) # $zero print(instr.rd.name()) # $zero
Debug
Known issues
deprecatedUsing Instruction.opcode().name() is deprecated in favor of Instruction.mnemonic_display(). The new method handles dynamic suffixed instructions (R5900EE) correctly.
fix
Use instr.mnemonic_display() instead of instr.opcode().name() to get the opcode string.
affects: >=2.0.0-alpha.8
gotchaThe library is a native extension (Rust/C) and wheels are provided for many platforms, but on PyPI only certain Python versions are prebuilt. If building from source, you need a Rust compiler and Cargo. Missing these causes a cryptic ImportError.
fix
Install prebuilt wheels by using a Python version and platform that has wheels (see PyPI). If you must build from source, install Rust via rustup.
affects: all
Errors
Common errors & fixes
ImportError: cannot import name 'Instruction' from 'rabbitizer'
Usually due to incomplete installation or building from source without the required dependencies (Rust compiler).
fix
Reinstall prebuilt wheels: pip install --force-reinstall rabbitizer. If that fails, check Python version compatibility.
AttributeError: 'Instruction' object has no attribute 'opcode'
In older versions (<1.x?) the API might be different, but in 1.16.0 'opcode' exists. Possibly a version mismatch or typo.
fix
Ensure you have version 1.16.0: pip install rabbitizer==1.16.0
ValueError: Invalid word: ...
The 32-bit word passed to Instruction() is not a valid MIPS instruction or has incorrect byte order.
fix
Ensure the word is a 32-bit integer (can be hex). For big-endian MIPS, you may need to byte-swap if reading from a little-endian file. Use struct.unpack('>I', ...) to get the correct word.
Upgrade
Version history
1.16.0latest on PyPI · released Apr 19, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
13 hits · last 30 days
node
12
OpenAI (training)
1
Resources