This release is a pre-release and may not be stable for production use.
cheader2json
Take one or more c header files as input, and do a JSON dump of a portion of the libclang AST for easier processing by other tools. This code was originally from the libclang based Python/Matlab binding generator for HELICS, but has been split out to make it more reusable. Functionality is also provided to do a diff of two JSON files, that can be used to get a quick overview of what has changed between releases.
Installation
pip install cheader2json
Recommended: Install in a Python virtual environment.
Usage
Convert a c header file to a JSON file with a subset of the AST (excluding function bodies) and a JSON file with type information:
cheader2json convert <HEADER_FILE>
Dump a pair of JSON files named example.ast.json and example.types.json for multiple header files, and ignore DO_SOMETHING macro
(the ignore macro option can be given more than once, or IGNORED_MACROS environment variable can be set to a space separated list of
macro names to ignore):
cheader2json convert <HEADER_FILE1> <HEADER_FILE2> --prefix=example --ignore-macro=DO_SOMETHING
Do a diff of two dumped AST JSON files:
cheader2json diff <JSON_AST_FILE_OLD> <JSON_AST_FILE_NEW>
Metadata
Release files for cheader2json 0.0.0rc2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cheader2json-0.0.0rc2.tar.gz | 13.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cheader2json-0.0.0rc2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.3 kB
Release files / cheader2json-0.0.0rc2.tar.gz
| Download URL | cheader2json-0.0.0rc2.tar.gz |
|---|---|
| Size | 13.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5e8f29780013bde315960f6c0cde23fc72b3a0e66eaaed9a0e24f0763336c592
|
|
BLAKE2b-256 checksum How to use checksums |
82af7b478e62a455ac34238bd11cd10db69c1c263381bb196563eab46b89e2e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|
Release files / cheader2json-0.0.0rc2-py3-none-any.whl
| Download URL | cheader2json-0.0.0rc2-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
657e02d9a50846a2773ae2a6b2ad6d4c7fccef27255e6a98a46eaa1b9180e3c8
|
|
BLAKE2b-256 checksum How to use checksums |
f53a40fb4f20d5d5e660796f7fa5f27c03bb869eba7516c180c91338ebe6105a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.7
|