Skip to main content
Latest release on the Python Cheeseshop (PyPI) Continuous integration Documentation building Code coverage of bytecode on codecov.io Ruff

bytecode is a Python module to generate and modify bytecode.

Install bytecode: python3 -m pip install bytecode. It requires Python 3.8 or newer. The latest release that supports Python 3.7 and 3.6 is 0.13.0. The latest release that supports Python 3.5 is 0.12.0. For Python 2.7 support, have a look at dead-bytecode instead.

Example executing print('Hello World!'):

from bytecode import Instr, Bytecode

bytecode = Bytecode([Instr("LOAD_GLOBAL", (True, 'print')),
                     Instr("LOAD_CONST", 'Hello World!'),
                     Instr("CALL", 1),
                     Instr("POP_TOP"),
                     Instr("LOAD_CONST", None),
                     Instr("RETURN_VALUE")])
code = bytecode.to_code()
exec(code)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bytecode-0.19.0.tar.gz (106.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bytecode-0.19.0-py3-none-any.whl (43.3 kB view details)

Uploaded Python 3

File details

Details for the file bytecode-0.19.0.tar.gz.

File metadata

  • Download URL: bytecode-0.19.0.tar.gz
  • Upload date:
  • Size: 106.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bytecode-0.19.0.tar.gz
Algorithm Hash digest
SHA256 fb733957396cb82301f3f79cd320aef262cd0592c93d6b4fd656771506999624
MD5 ba6290659c3480c1d76fd25c87a287aa
BLAKE2b-256 c6e99f355e80d57fc271d35631883778564aeea02c35b4cfb4b64d84cb653aed

See more details on using hashes here.

Provenance

The following attestation bundles were made for bytecode-0.19.0.tar.gz:

Publisher: release.yml on MatthieuDartiailh/bytecode

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bytecode-0.19.0-py3-none-any.whl.

File metadata

  • Download URL: bytecode-0.19.0-py3-none-any.whl
  • Upload date:
  • Size: 43.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bytecode-0.19.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7b32811d4a574f5ebcdc84ae8d37af928d980f31d6aa5aea2cab9f6d364489d1
MD5 b17d1e85b9c2193885c9456b6c754717
BLAKE2b-256 ae38c8397880426bb56b139a0b53f69a4e54cf770c358b8c1ad872b3c88430d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for bytecode-0.19.0-py3-none-any.whl:

Publisher: release.yml on MatthieuDartiailh/bytecode

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release
Image

0.19.0 This release

2 files

Image

0.18.1

2 files

Image

0.18.0

2 files

Image

0.17.0

2 files

Image

0.16.2

2 files

Image

0.16.1

2 files

Image

0.16.0

2 files

Image

0.15.1

2 files

Image

0.15.0

2 files

Image

0.14.2

2 files

Image

0.14.1

2 files

Image

0.14.0

2 files

Image

0.13.0

2 files

Image

0.12.0

2 files

Image

0.11.0

2 files

Image

0.10.0

2 files

Image

0.9.0

2 files

Image

0.8.0

2 files

Image

0.7.0

2 files

Image

0.6.0

2 files

Image

0.5

2 files

Image

0.4

2 files

Image

0.3

2 files

Image

0.2

2 files

Image

0.1

2 files

Image

0.0

2 files

Image Anthropic, PBC Visionary sponsor Image Bloomberg Visionary sponsor Image Hudson River Trading Visionary sponsor Image Meta Visionary sponsor Image NVIDIA Visionary sponsor Image Microsoft Sustainability sponsor Image Depot Continuous Integration Image AWS Cloud computing and Security Sponsor Image Datadog Monitoring Image Fastly CDN Image Google Download Analytics Image Sentry Error logging Image StatusPage Status page