--- id: pycparser version: "3.0" license: BSD-3-Clause license_treatment: permissive maintenance: active --- # pycparser — C parser in Python License: permissive · Maintenance: active · Popularity: top 100 on PyPI ## Install pip install pycparser uv add pycparser poetry add pycparser ## Description =============== pycparser v3.00 =============== .. image:: https://github.com/eliben/pycparser/workflows/pycparser-tests/badge.svg :align: center :target: https://github.com/eliben/pycparser/actions ---- .. contents:: :backlinks: none .. sectnum:: Introduction ============ What is pycparser? ------------------ **pycparser** is a parser for the C language, written in pure Python. It is a module designed to be easily integrated into applications that need to parse C source code. What is it good for? -------------------- Anything that needs C code to be parsed. The following are some uses for **pycparser**, taken from real user reports: * C code obfuscator * Front-end for various specialized C compilers * Static code checker * Automatic unit-test discovery * Adding specialized extensions to the C language One of the most popular uses of **pycparser** is in the `cffi `_ library, which uses it to parse the declarations of C functions and types in order to auto-generate FFIs. **pycparser** is unique in the sense that it's written in pure Python - a very high level language that's easy to experiment with and tweak. To people... ## AI interpretation — verify before relying pycparser is a pure-Python parser for C code that parses C99 and some C11 syntax into an abstract syntax tree, enabling programmatic analysis and transformation of C source without external dependencies. Verdict: A mature, dependency-free C parser in active development with strong community adoption (top 100 PyPI). No known vulnerabilities and permissive licensing make it a reliable choice for C code analysis and tooling. The main gotcha is the preprocessor requirement—not a blocker, but a necessary step for real-world C code. [View on SkillFed](https://skillfed.io/packages/pycparser) · [View on PyPI](https://pypi.org/project/pycparser/)