skillfed

pyevmasm

Ethereum Virtual Machine (EVM) assembler and disassembler

pyevmasm v0.2.3 84.8K downloads/30d#13,968 on PyPI387
Permissive license Apache License 2.0 Active released

What it is and what it does

pyevmasm is a Python library for assembling human-readable EVM assembly into bytecode and disassembling bytecode back into readable instructions. It provides both a command-line tool (evmasm) and a Python API, supporting multiple Ethereum protocol forks (frontier, homestead, tangerine_whistle, spurious_dragon, byzantium, constantinople, serenity) so you can work with bytecode from different network versions. The library depends only on future, making it lightweight to install.

Developers use it to analyze compiled smart contracts, manipulate EVM bytecode programmatically, or build tools that need to understand or generate Ethereum bytecode. The CLI accepts hex input/output and can read from stdin or files, while the Python API lets you query instruction tables, disassemble bytecode into instruction objects, modify them, and reassemble them back to hex.

Use it for:

  • Analyze compiled Ethereum smart contract bytecode to understand its structure and operations.
  • Build security analysis or fuzzing tools that need to manipulate or inspect EVM instructions.
  • Generate or modify EVM bytecode programmatically for contract testing or research.
  • Support multiple Ethereum forks in tooling by selecting the appropriate instruction set.
  • Disassemble bytecode from the blockchain to reverse-engineer contract logic.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

pyevmasm assembles and disassembles Ethereum Virtual Machine bytecode, providing both a command-line tool and a Python API for working with EVM instructions across multiple protocol forks.

Yes, if you work with Ethereum bytecode analysis or manipulation. The package is lightweight, actively maintained, permissively licensed, and has no known vulnerabilities. The 2020 release date is a minor signal to check whether it covers your target EVM forks, but the active repository and recent commits suggest ongoing support. Install it if you need EVM assembly/disassembly; skip it if you only work with high-level smart contract code.

Install

pyevmasm on PyPI

pip

pip install pyevmasm

uv

uv add pyevmasm

poetry

poetry add pyevmasm

Installing pyevmasm

Before you install

Low install friction with a single lightweight dependency (future). The package is actively maintained with recent commits, though the latest release was in 2020; the repository remains active and not archived.

License in practice

Licensed under Apache License 2.0, a permissive license allowing commercial and private use with minimal restrictions, making it safe to integrate into most projects.

Quickstart

pip install pyevmasm

from pyevmasm import disassemble_hex, assemble_hex

# Disassemble bytecode
print(disassemble_hex('0x608060405260043610603f57600035'))

# Assemble instructions
result = assemble_hex('PUSH1 0x40\nMSTORE\n')
print(result)

Requires Python >2.7; the description notes Python >=3.10 is required for current development.

Verify before relying

  • Whether the package actively supports all currently-used EVM forks beyond those listed in the CLI help (frontier through serenity).
  • Current test coverage and whether the 2020 release date reflects actual maintenance gaps or merely infrequent version bumps.

Package facts

License Apache License 2.0 (permissive)
Python support supports the current Python release (>2.7)
Install friction low — pure-Python wheel
Runtime dependencies 1 — future
Maintenance actively maintained — 2,310 days since the last release
Last repo commit
First released
Downloads 84,823/month — #13,968 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pyevmasm-0.2.3-py2-none-any.whl; pyevmasm-0.2.3-py3-none-any.whl

Tags

ethereum bytecode assembler disassemblerevm instruction assemblyethereum virtual machine toolsevm opcode manipulationsmart contract bytecode analysisethereum bytecode compilerevm fork-aware assembly
ethereumbytecode-analysisevm

More Build Tools packages