oxradon
oxradon is a Rust port of radon, Michele Lacchia's code-metrics tool for Python. It takes the same commands and flags and prints the same output, in a fraction of the time.
$ oxradon cc -s -a src/
src/orders.py
F 12:0 process_order - D (24)
C 35:0 Cart - A (4)
M 40:4 Cart.total - A (3)
3 blocks (classes, functions, methods) analyzed.
Average complexity: B (10.333333333333334)
Features
- Fast. 25x to 776x faster than radon on real projects (benchmark).
- Same output. Your existing thresholds and scripts keep working (compatibility).
- Same configuration. Reads
radon.cfg,setup.cfg,pyproject.toml,~/.radon.cfgandRADONCFG. - Doesn't give up. Reports a file it can't read and moves on, in cases where radon stops.
- No Python required. One binary, also usable as a Rust library.
Install
uv tool install oxradon # or: pipx install oxradon, or: pip install oxradon
Prebuilt for Linux (x86-64 and ARM, including Alpine) and macOS (Apple silicon and Intel). There
is no Windows build. To try it once, run uvx oxradon cc -s src/. With Rust 1.97 or newer,
cargo install oxradon builds it from source.
Then run oxradon wherever you ran radon, for example oxradon cc -nc -s src/. The two can be
installed side by side.
When to keep using radon
oxradon has all four of radon's commands (cc, hal, raw, mi) with all their flags, and
reads the same configuration files. Stay with radon if you:
- analyze Jupyter notebooks (oxradon accepts the notebook flags but skips notebooks);
- need
cc --xml,--mdor--codeclimate; - import radon from Python;
- work on Windows.
Compatibility
oxradon is checked against radon 6.0.1 on Python 3.14.10, on macOS and Linux. The test corpus is the Python standard library plus eight popular packages: Django, SymPy, SQLAlchemy, Pydantic, Rich, Black, FastAPI and httpx. Output was compared byte for byte:
| Command | Files compared | Differences |
|---|---|---|
cc |
4,828 | 0 |
hal |
5,697 | 0 |
raw |
5,698 | 0 |
mi |
5,697 | 0, apart from the wording of syntax errors |
radon's quirks are reproduced too. If you find a file where the two disagree, please open an issue.
Two things vary by machine, for radon too. The last digit of an mi score depends on the
system's math library. A directory's files come out in the order the file system lists them.
Where they differ
| Situation | radon | oxradon |
|---|---|---|
hal on a file it can't read or parse |
stops the whole run | reports the file and continues |
| Very deeply nested code | recursion error for that file | analyzes it |
A file name containing { or } |
crashes while printing it | prints it |
Paths after an option (hal a.py -f b.py) |
usage error | analyzes every path |
RADONFILESENCODING |
any Python codec | utf-8, utf-8-sig, latin-1, ascii and cp1252 only |
--exclude -1 (a value that looks like a negative number) |
accepted | usage error; write --exclude=-1 |
| Syntax error messages | Python's wording | Python's wording, or Ruff's for errors only the parser finds |
-O file |
writes color codes into the file | plain text unless COLOR=yes |
--help |
radon's help text | its own help text, same options |
COMPATIBILITY.md has the rarer cases and how all this was tested.
Benchmark
Measured with scripts/bench.py on an Apple M5 with 10 cores and a warm file cache. Each time is
the best of 7 runs, except radon's hal, raw and mi, which got 3. The script first checks that radon analyzed
every file. hal uses -j because radon's text output stops at the first file it can't parse.
| Command | Code analyzed | radon | oxradon | oxradon, 1 core |
|---|---|---|---|---|
cc -s |
CPython 3.14 stdlib (1,872 files) | 5.00 s | 90 ms (56x) | 311 ms (16x) |
cc -s |
Third-party packages (3,824 files) | 6.89 s | 167 ms (41x) | 482 ms (14x) |
hal -j |
stdlib | 3.96 s | 131 ms (30x) | 350 ms (11x) |
hal -j |
Third-party packages | 6.55 s | 259 ms (25x) | 653 ms (10x) |
raw -s |
stdlib | 32.1 s | 206 ms (156x) | 500 ms (64x) |
raw -s |
Third-party packages | 139 s | 179 ms (776x) | 771 ms (180x) |
mi -s |
stdlib | 38.1 s | 224 ms (170x) | 957 ms (40x) |
mi -s |
Third-party packages | 156 s | 326 ms (478x) | 1.52 s (103x) |
| any | One small file | 34-36 ms | 3 ms (11-12x) | 3 ms (12-13x) |
cc and hal gain from Ruff's compiled parser and from using every core. raw and mi gain
much more. For each logical line, radon re-tokenizes a growing buffer, which is quadratic in long
statements. oxradon gets the same answers in one pass, so most of that gap is the algorithm, not
Rust. The one-file row is mostly Python's start-up time.
Use as a library
Each command's analysis is a function that takes Python source as text:
let source = "def pick(x):\n return x or 1\n";
let blocks = oxradon::cc::analyze(source, &oxradon::cc::Options::default())?;
assert_eq!(blocks[0].complexity(), 2);
let lines = oxradon::raw::analyze(source)?;
assert_eq!(lines.loc, 2);
oxradon::hal::analyze and oxradon::mi::analyze work the same way. cargo doc --open shows
the full API.
Development
cargo test --no-fail-fast # no Python needed: replays recordings made from radon and CPython
cargo clippy --all-targets
cargo fmt --check
cargo doc --no-deps
The scripts in scripts/ compare oxradon with a real radon install.
CONTRIBUTING.md explains
the setup and what a change has to pass.
How it was built
oxradon was written with AI coding assistants (Claude and Codex). Where radon's behavior was unclear, the answer came from reading radon's and CPython's source instead of guessing from examples.
Credits and license
oxradon ports radon's algorithms and output formats. radon was written by Michele Lacchia and
its contributors; oxradon is independent of them and not affiliated. Parsing uses
Ruff's Python parser, and the tokenizer, tomllib and
fnmatch are ported from CPython.
oxradon is MIT licensed, as is radon (© 2012-2017 Michele Lacchia). Both notices are in LICENSE.
Metadata
Release files for oxradon 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 10.5 MB
Release files / oxradon-0.1.0-py3-none-musllinux_1_2_x86_64.whl
| Download URL | oxradon-0.1.0-py3-none-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.9 MB |
| Tags | Linux musl 1.2+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
d1657bf7db7d6df396fa8249e22a905e94c4ac0dad90ab92ab896af03b9fe925
|
|
BLAKE2b-256 checksum How to use checksums |
96702c2760cdd2611549b98fee80aca9df5206ae9415d99c879787cf2a8c69cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / oxradon-0.1.0-py3-none-musllinux_1_2_aarch64.whl
| Download URL | oxradon-0.1.0-py3-none-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | Linux musl 1.2+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
b821d8bd02fedf1f0314d4ef18a1be0d864eedf861c3c2e7e35bea8c594785c9
|
|
BLAKE2b-256 checksum How to use checksums |
dc1e0428985682ae521edd31c68127f29ca0abe397a334ede4c890c8ba0066ad
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / oxradon-0.1.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | oxradon-0.1.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 1.8 MB |
| Tags | Linux glibc 2.17+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
ca88ed8e7592845fb0479e839a1ed42dad607b585729b9ac8d73d708b44c974d
|
|
BLAKE2b-256 checksum How to use checksums |
98088e56e0184c0139f00561f7c142f99df77d2d3ec96db0184313b1d8142715
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / oxradon-0.1.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
| Download URL | oxradon-0.1.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | Linux glibc 2.17+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
fcc997f5d5a65bf9b31e474db91abf3e34274ac39af1d23c94667f0ea8007875
|
|
BLAKE2b-256 checksum How to use checksums |
9209d8bb9aa12c63946a693573be359d6c1a11c4a340a5dbf4199c34fe4a00b2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / oxradon-0.1.0-py3-none-macosx_11_0_arm64.whl
| Download URL | oxradon-0.1.0-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.6 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
1906ac401b68516b5e3b8c9d495d03c2f05e2cac5a854af3061e9fde4e0aea26
|
|
BLAKE2b-256 checksum How to use checksums |
631692b9c0d65e4dce40ba50d762b181570582a6306434569754cb959e2a4d4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logRelease files / oxradon-0.1.0-py3-none-macosx_10_12_x86_64.whl
| Download URL | oxradon-0.1.0-py3-none-macosx_10_12_x86_64.whl |
|---|---|
| Size | 1.7 MB |
| Tags | Python 3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
d7c678fc739e0787b3177c80266f9c3c2e7bd34a3ccb14c04c6e304df6f74fc1
|
|
BLAKE2b-256 checksum How to use checksums |
68dc56fb172b3e62d094c0895dffc76fc057207eafd856818d2f490e3e6af595
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logSecurity for oxradon 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 6 files in this release have been uploaded with provenance metadata.
Attestation for oxradon-0.1.0-py3-none-musllinux_1_2_x86_64.whl
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.