Anonymise identifiers / constants / metadata inside a CPython .pyc while preserving the opcode stream — for contamination-free decompiler benchmarking
Project description
pychd-pyobf
Anonymise identifiers, string constants, docstrings, and metadata
inside a CPython .pyc while preserving the opcode stream exactly.
Built to neutralise LLM training-data memorisation when benchmarking
Python decompilers: even if an LLM has seen the original source on
the internet, the anonymised .pyc does not contain the surface
tokens (variable names, comments, docstrings) it would use to
recognise the source.
Covers every CPython release pychd recognises: 3.0–3.14.
- 3.14 (the running interpreter) is rewritten natively via
types.CodeType.replace(). - 3.0–3.13 are rewritten via a subprocess into a uv-managed Python of that minor version, so the obfuscator stays a tiny dependency.
Pair with pychd-pyfuzz (random valid-Python source generator) for
the strongest available contamination guarantee.
See the main pychd README for the broader story.
Install
pip install pychd-pyobf
Use
pychd-pyobf rewrite IN.pyc OUT.pyc --mapping mapping.json
The --mapping flag (optional) writes the original-to-anonymised
identifier dict to JSON for audit / debugging. Without it, the
mapping is discarded after rewriting.
Status
Pre-release. API and CLI are still evolving with the parent project.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pychd_pyobf-0.1.0.tar.gz.
File metadata
- Download URL: pychd_pyobf-0.1.0.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a1e839ec307f2a080fe695f84d14ef40289a45d4f005e3be6645c51c7f3a452
|
|
| MD5 |
2ae7f2c2425b693eb180d65bc8dfaaa4
|
|
| BLAKE2b-256 |
646ec8575e4ab5f8b7c03e6c174cb419871431a246a378b7bcf5ff954d643665
|
Provenance
The following attestation bundles were made for pychd_pyobf-0.1.0.tar.gz:
Publisher:
publish-pyobf.yaml on diohabara/pychd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pychd_pyobf-0.1.0.tar.gz -
Subject digest:
3a1e839ec307f2a080fe695f84d14ef40289a45d4f005e3be6645c51c7f3a452 - Sigstore transparency entry: 1643941884
- Sigstore integration time:
-
Permalink:
diohabara/pychd@414d779fd6312826fb4c622dfc8102971f82d110 -
Branch / Tag:
refs/tags/pyobf-v0.1.0 - Owner: https://github.com/diohabara
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pyobf.yaml@414d779fd6312826fb4c622dfc8102971f82d110 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pychd_pyobf-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pychd_pyobf-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e854f58fb482dc40c5ed65aa509b9d8d8f8520a315a04882d19e9018318543ac
|
|
| MD5 |
124cb77496f265d379ebb3cb6d73b415
|
|
| BLAKE2b-256 |
de9b9fbb74a9c2e22c065e395503369183d136f12196fc72cea3cc67dc430bfa
|
Provenance
The following attestation bundles were made for pychd_pyobf-0.1.0-py3-none-any.whl:
Publisher:
publish-pyobf.yaml on diohabara/pychd
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pychd_pyobf-0.1.0-py3-none-any.whl -
Subject digest:
e854f58fb482dc40c5ed65aa509b9d8d8f8520a315a04882d19e9018318543ac - Sigstore transparency entry: 1643942324
- Sigstore integration time:
-
Permalink:
diohabara/pychd@414d779fd6312826fb4c622dfc8102971f82d110 -
Branch / Tag:
refs/tags/pyobf-v0.1.0 - Owner: https://github.com/diohabara
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pyobf.yaml@414d779fd6312826fb4c622dfc8102971f82d110 -
Trigger Event:
push
-
Statement type: