PYC
Generated by scripts/gen-format-pages.py from docs/data/format-metadata/, FILE_FORMATS.csv and docs/formats-master.csv. Do not edit by hand: change the source, then run the script.
Python Bytecode Preview.
At a glance
| Purpose | A compiled Python file (.pyc): a header and one marshalled code object. |
| Extensions | .pyc |
| Poka parser | poka-pyc |
| Viewer | poka-tree-viewer |
| Depth tier | Parser with a shared viewer (see Depth tiers) |
| Breadth tier | B3 Core (see Breadth tiers) |
How much Poka reads
B3 Core. Only the main content type or types are decoded (for example geometry but not materials, layers or annotations, or only one version family). The list of gaps is substantial.
Confidence: medium (the reviewer read the code). Basis: Reviewed 2026-10-26: read parsers/poka-pyc/src/main.rs (634 lines) and plugin.json. No unit tests or tests/samples.rs; the corpus has poka_sample_module.pyc, sample.pyc, read by no test. Covers .pyc. The tree identifies the Python version from the magic, reads the header (legacy timestamp or hash-based) and walks the marshal stream for the module code object and every nested code object (functions and classes) with name, argument count, flags, file name and first line, across the 3.x layouts up to 3.11 and later. Judgement: B3: the code-object hierarchy is decoded, but the bytecode is not.
What Poka does not read
- Bytecode is not disassembled
- Constants other than nested code objects, names and line tables are not shown
- Python 2 .pyc files and unknown magics show the version and a note only (judgement from the code)
- Caps of 3,000 nodes and 64 levels
Libraries
Libraries Poka uses or has assessed for this format, with the status, licence and language the registry records.
- marshal-parser (candidate; MIT; Rust; https://github.com/decathorpe/marshal-parser) — Parses marshal data and pyc files (CPython 3.6 to below 3.14 per docs); v0.1.1, June 2024.
- py-marshal (candidate; MIT; Rust; https://github.com/sollyucko/py-marshal) — Port of CPython marshal.c; last updated April 2023, so may lag newer Python versions.
- Decompyle++ (pycdc/pycdas) (reference; GPL-3.0; C++; https://github.com/zrax/pycdc) — copyleft; Python bytecode disassembler and decompiler.
- xdis (reference; GPL-2.0; Python; https://pypi.org/project/xdis/) — copyleft; Cross-version byte-code disassembler and marshal routines; v6.3.0.
- pyc_editor (reference; GPL-3.0-or-later; Rust; https://github.com/Svenskithesource/pyc-editor) — copyleft; Read/modify/write pyc files; supports 3.10-3.13 per docs.rs; v0.4.10, July 2026.
Sources
- parsers/poka-pyc/src/main.rs
- parsers/poka-pyc/plugin.json