Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
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.
pip install cheader2json
Recommended: Install in a Python virtual environment.
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>
FAQs
Parse C header file and output JSON ast + types
We found that cheader2json demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.