Skip to main content

wayward-eagle

Lowers the cognitive complexity (SonarSource's metric, as clang-tidy's readability-function-cognitive-complexity counts it) of C functions, as pycparser c_ast, keeping what each function does. Each rewrite is made only where it lowers the cost. wayward-eagle reduce FILE.c [-o OUT.c] [-I DIR] reduces every function of a C file.

from wayward_eagle import c

# fd: a pycparser c_ast.FuncDef, from c.load(...).functions or built by hand
pieces = c.reduce_function(fd, noreturn={"trap"}, status=None)
print(c.render(c.prototypes(pieces) + pieces))  # the static pieces first, fd's own last
  • C layer: wayward_eagle.c.load reads C through a pinned clang into c_ast with clang's types, implicit casts, declarations and source ranges; queries, rendering and reduce_function.
  • Rewrites: what each rewrite does and when it applies.
  • Census: wayward-eagle census FILE.c... [-I DIR] [--json] lists C's readability defects by class (clang-tidy's checks and checks over clang's AST: dead stores, extraneous variables and casts, obscured control flow, meaningless names, raw memory blocks and hardware addresses, ...), each function's local variables (and their definitions by why they exist), lines and statements, and the wayward-census virtuous-cycles adapter ratchets them.

Install: pip install wayward-eagle. Development: pip install -e .[dev], then pytest -n auto --cov=wayward_eagle (CI adds --pysayme --pysayme-behaviour: no code duplicating its own or its dependencies').

Metadata

Release files for wayward-eagle 0.5.12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wayward-eagle 0.5.12
File Size Uploaded Provenance Actions
wayward_eagle-0.5.12.tar.gz 143.8 kB With provenance Details for wayward_eagle-0.5.12.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for wayward-eagle 0.5.12
File Interpreter ABI Platform Actions
wayward_eagle-0.5.12-py3-none-any.whl Python 3 none any Details for wayward_eagle-0.5.12-py3-none-any.whl

Total release size: 260.2 kB

Release files / wayward_eagle-0.5.12.tar.gz

Download URL wayward_eagle-0.5.12.tar.gz
Size 143.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e7e4c8408ffae00b57e3b2db934f911078fc88e96326f0f6158bcb1352aba200
BLAKE2b-256 checksum
How to use checksums
59b0aa12fe669733e8c3734ced4ca6e1711625a4d04d3c66616fc95f1b9c74a8
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 28, 2026.

Transparency log

Release files / wayward_eagle-0.5.12-py3-none-any.whl

Download URL wayward_eagle-0.5.12-py3-none-any.whl
Size 116.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
27a58007a50f41406ccd3ff27504b26fe1aeff284af4f6aaa09e85ed7e7ac65e
BLAKE2b-256 checksum
How to use checksums
ab72842a7507c396f17347df0917a080b1fa0a6b40c2e7ef00d3c4af08f620d3
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 28, 2026.

Transparency log

Security for wayward-eagle 0.5.12

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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for wayward_eagle-0.5.12.tar.gz

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 28, 2026.

Transparency log

A 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.

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