C language utils and tools based on the clang and binutils modules.
Project description
C language utils and tools based on the clang and binutils modules.
Installation
Install clanguru using pipx for isolated installation:
pipx install clanguru
Usage
Clanguru provides four main commands for C/C++ code analysis and utility operations:
- Documentation: Generate (minimal) documentation for C/C++ sources functions and classes. It supports multiple output formats including Myst Markdown, standard Markdown, and RestructuredText.
- Testing: Create mock objects for unit testing C functions
- Analysis: Understand object file dependencies and symbol usage. It can generate HTML and Excel reports.
Check the help message for more details:
clanguru --help
Usage: clanguru [OPTIONS] COMMAND [ARGS]...
C language utils and tools based on the libclang module.
╭─ Options ────────────────────────────────────────────────────────────╮
│ --version -v Show version and exit. │
│ --help Show this message and exit. │
╰──────────────────────────────────────────────────────────────────────╯
╭─ Commands ───────────────────────────────────────────────────────────╮
│ docs Generate documentation for C/C++ source code. │
│ mock Generate mocks for C functions and variables. │
│ parse Parse C source code and print the translation unit. │
│ analyze Analyze object files dependencies. │
╰──────────────────────────────────────────────────────────────────────╯
For detailed help on each command, use the --help option with the command name.
clanguru analyze --help
Object File Analysis
Clanguru can analyze object files to understand their dependencies and symbol usage.
For this, you need to build your project and provide the compilation database (compile_commands.json).
Also, ensure that the nm command-line tool is available in your system PATH.
To generate an html dynamic dependency report, run the following command:
clanguru analyze --compilation-database compile_commands.json --output-file dependencies.html --use-parent-deps
[!NOTE] Here is the generated HTML report for my smart home temperature sensor project: https://maxiniuc.com/objects_deps/index.html. I only wrote some lines of code to make a temperature sensor available as a
matterdevice but the esp32 modules, matter stack, and all the libraries bring a lot of code and dependencies. 🫣 Feel free to move the nodes around and explore the dependencies.
If the output file ends with .xlsx, an Excel report will be generated instead of an HTML one.
Contributing
The project uses UV for dependencies management and packaging and the pypeline for streamlining the development workflow.
Use pipx (or your favorite package manager) to install the pypeline in an isolated environment:
pipx install pypeline-runner
To bootstrap the project and run all the steps configured in the pypeline.yaml file, execute the following command:
pypeline run
For those using VS Code there are tasks defined for the most common commands:
- run tests
- run pre-commit checks (linters, formatters, etc.)
- generate documentation
See the .vscode/tasks.json for more details.
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 clanguru-0.15.0.tar.gz.
File metadata
- Download URL: clanguru-0.15.0.tar.gz
- Upload date:
- Size: 32.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1edf7000fa30a10f4422db9566d5624cf243d4e61abfd6f24d75ac79b4cfbd1
|
|
| MD5 |
be6f1e63d6fa403a560c704be4397ee7
|
|
| BLAKE2b-256 |
2872744f7e6e1c11fed5b7e06b5a13d59573a7be2c21294c07ca6f530537b040
|
Provenance
The following attestation bundles were made for clanguru-0.15.0.tar.gz:
Publisher:
ci.yml on cuinixam/clanguru
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
clanguru-0.15.0.tar.gz -
Subject digest:
e1edf7000fa30a10f4422db9566d5624cf243d4e61abfd6f24d75ac79b4cfbd1 - Sigstore transparency entry: 605550413
- Sigstore integration time:
-
Permalink:
cuinixam/clanguru@38f93ca420800cc6559e431f1e5ed45280427f55 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/cuinixam
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@38f93ca420800cc6559e431f1e5ed45280427f55 -
Trigger Event:
push
-
Statement type:
File details
Details for the file clanguru-0.15.0-py3-none-any.whl.
File metadata
- Download URL: clanguru-0.15.0-py3-none-any.whl
- Upload date:
- Size: 34.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf48feff1ee46c480e74e1592f87e50768d5bc281895e1dd287474850e51adfe
|
|
| MD5 |
68918d55788f47337d3a127b4733d851
|
|
| BLAKE2b-256 |
c849a86be19c281f8c38ec065ddea14994fe92f3460d1599d51452fb332bc45e
|
Provenance
The following attestation bundles were made for clanguru-0.15.0-py3-none-any.whl:
Publisher:
ci.yml on cuinixam/clanguru
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
clanguru-0.15.0-py3-none-any.whl -
Subject digest:
bf48feff1ee46c480e74e1592f87e50768d5bc281895e1dd287474850e51adfe - Sigstore transparency entry: 605550420
- Sigstore integration time:
-
Permalink:
cuinixam/clanguru@38f93ca420800cc6559e431f1e5ed45280427f55 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/cuinixam
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@38f93ca420800cc6559e431f1e5ed45280427f55 -
Trigger Event:
push
-
Statement type: