skillfed

bytecode

Python module to generate and modify bytecode

bytecode Permissive license The MIT License (MIT) Copyright Contributors to the bytecode project. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files… (full text in the JSON record) Active 340 v0.18.1 released

Install

bytecode on PyPI

pip

pip install bytecode

uv

uv add bytecode

poetry

poetry add bytecode

Package facts

License The MIT License (MIT) Copyright Contributors to the bytecode project. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files… (full text in the JSON record) (permissive)
Python support supports the current Python release (>=3.11)
Install friction low — pure-Python wheel
Runtime dependencies 1 — typing_extensions
Maintenance actively maintained — 71 days since the last release
Last repo commit
First released
Popularity one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13)
Known vulnerabilities none known (OSV.dev, checked 2026-08-13)

Evidence: bytecode-0.18.1-py3-none-any.whl

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Libraries :: Python Modules

About bytecode

from the package's own PyPI description — quoted content, verbatim


bytecode


.. image:: https://img.shields.io/pypi/v/bytecode.svg :alt: Latest release on the Python Cheeseshop (PyPI) :target: https://pypi.python.org/pypi/bytecode

.. image:: https://github.com/MatthieuDartiailh/bytecode/workflows/Continuous%20Integration/badge.svg :target: https://github.com/MatthieuDartiailh/bytecode/actions :alt: Continuous integration

.. image:: https://github.com/MatthieuDartiailh/bytecode/workflows/Documentation%20building/badge.svg :target: https://github.com/MatthieuDartiailh/bytecode/actions :alt: Documentation building

.. image:: https://img.shields.io/codecov/c/github/MatthieuDartiailh/bytecode/master.svg :alt: Code coverage of bytecode on codecov.io :target: https://codecov.io/github/MatthieuDartiailh/bytecode

.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json :target: https://github.com/astral-sh/ruff :alt: Ruff

bytecode is a Python module to generate and modify bytecode.

  • bytecode project homepage at GitHub <https://github.com/MatthieuDartiailh/bytecode>_ (code, bugs)
  • `bytecode documentation...

Read as markdown · JSON record · Source repository · Docs

AI interpretation — verify before relying

AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page

bytecode generates and modifies Python bytecode objects, allowing programmatic creation of executable code from low-level instruction sequences.

Low friction: pure-Python wheel with a single lightweight runtime dependency (typing_extensions). Active maintenance with a recent release 71 days ago and ongoing repository activity.

MIT license permits unrestricted use, modification, and distribution with minimal obligations—suitable for both open-source and commercial projects.

Usage

pip install bytecode
from bytecode import Instr, Bytecode
bytecode_obj = Bytecode([Instr("LOAD_GLOBAL", (True, 'print')), Instr("LOAD_CONST", 'Hello')])
code = bytecode_obj.to_code()
exec(code)

Requires Python 3.11 or newer; earlier Python versions are not supported by this release.

Verdict: bytecode is a well-maintained, low-friction library for bytecode generation with permissive licensing and no known vulnerabilities. It is suitable for projects requiring programmatic code generation at the bytecode level, though adoption should account for its Python 3.11+ requirement.

Needs verification

  • Whether bytecode's instruction set API remains stable across Python minor versions (3.11–3.14).
  • Performance characteristics and memory overhead when generating large bytecode objects.
  • Compatibility guarantees for bytecode generated on one Python version executed on another.
python bytecode generationbytecode manipulation librarygenerate python code objectsbytecode compilermodify python bytecodeinstruction-level code generationbytecode assembler

Similar packages