--- id: cppheaderparser version: "2.7.4" license: BSD license_treatment: permissive maintenance: abandoned --- # CppHeaderParser — Parse C++ header files and generate a data structure representing the class License: permissive · Maintenance: abandoned · Downloads: 82.1K/mo ## What it is and what it does CppHeaderParser is a Python library that reads C++ header files and builds a dictionary-like data structure representing their contents. It extracts classes with their public, protected, and private methods and properties; namespaces and nested classes; free functions; preprocessor defines; and include directives. It also parses Doxygen-style documentation comments attached to methods and properties. The package uses PLY (Python Lex-Yacc) to tokenize and parse C++ syntax. It is intended for code generation, documentation extraction, or automated analysis of C++ codebases from Python. However, it has been abandoned since 2016 and does not track modern C++ features. Use it only when you need to extract structure from legacy C++ headers or when no active parser meets your needs. Use it for: - Extract class and method signatures from C++ headers for automated code generation or wrapper creation. - Parse Doxygen documentation from header files to build API documentation programmatically. - Analyze C++ codebases to gather metrics on class hierarchies, method counts, or namespace organization. - Generate Python bindings or language bindings for C++ libraries by introspecting header structure. - Audit or refactor C++ code by extracting public/private method and property inventories. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Parses C++ header files and extracts their structure—classes, methods, properties, namespaces, and free functions—into a Python data structure for programmatic inspection. No, unless you have a specific legacy codebase or no active alternative. The package is abandoned (last release 2016), has high install friction, and does not support modern C++ syntax. For new projects, use an active C++ parser or AST tool. For existing code depending on it, consider migration. ## Install pip install cppheaderparser uv add cppheaderparser poetry add cppheaderparser ## Installing CppHeaderParser Before you install: High install friction: the package is abandoned (last release 2016-11-22, no commits tracked). No runtime dependencies listed, but the description notes PLY as an external requirement. Maintenance status makes this a legacy choice; use only if no active alternative exists. License in practice: BSD license (permissive) imposes no significant restrictions on use, modification, or distribution. Suitable for both open-source and proprietary projects. Quickstart: import CppHeaderParser try: cppHeader = CppHeaderParser.CppHeader("example.h") sampleClass = cppHeader.classes["SampleClass"] methods = sampleClass["methods"]["public"] except CppHeaderParser.CppParseError as e: print(e) PLY (Python Lex-Yacc) must be installed separately; the package requires a valid C++ header file path and does not handle all C++ syntax variations. Verify before relying: - Whether PLY is automatically installed as a dependency or must be installed separately. - Compatibility with modern C++ standards (C++11, C++17, C++20) beyond what the 2016 release supports. - Whether the parser handles template declarations, constexpr, and other modern C++ features. ## Package facts - License: BSD (permissive) - Python support: unspecified - Install friction: high - Maintenance: abandoned - Downloads: 82.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags c++ header file parser, parse c++ class definitions, extract c++ metadata, c++ code analysis python, header file introspection, c++ ast parser, parse c++ declarations, c++-parsing, code-generation, legacy [View on SkillFed](https://skillfed.io/packages/cppheaderparser) · [View on PyPI](https://pypi.org/project/cppheaderparser/)