bytecode
Python module to generate and modify bytecode
Install
bytecode on PyPI
pip
pip install bytecodeuv
uv add bytecodepoetry
poetry add bytecodePackage 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
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...
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.
Similar packages
permissive · top 1,000 on PyPI
typing-inspectionpermissive · top 100 on PyPI
backports.tarfilepermissive · top 1,000 on PyPI
ruffpermissive · top 1,000 on PyPI
typermissive · top 1,000 on PyPI
uvpermissive · top 1,000 on PyPI
uv-buildpermissive · top 1,000 on PyPI
backports.asyncio.runnerpermissive · top 1,000 on PyPI
jaraco.functoolspermissive · top 1,000 on PyPI
testcontainerspermissive · top 1,000 on PyPI