🍺 BREW Explorer

← all formulae

pycparser

brew install pycparser v3.0 BSD-3-Clause

Pure-Python C language parser, commonly used by cffi and code analysis tools.

Why you might care

pycparser lets you parse C code from Python without external dependencies, making it ideal for building linters, code generators, obfuscators, or FFI tools. It's the engine behind cffi's C declaration parsing and popular in static analysis. Choose it when you need programmatic C AST access from Python and can tolerate the speed tradeoff versus C-based parsers.

Categories

Alternatives

libclang tree-sitter gcc
14.2k
30-day installs · #293
54.7k
90-day · #260
245.2k
365-day · #249
3.5k
★ GitHub stars · updated 12d ago

Build dependencies

Links

Blurb generated by claude-haiku-4-5 on today.

Raw metadata
{
  "aliases": [],
  "alternatives": [
    "libclang",
    "tree-sitter",
    "gcc"
  ],
  "build_dependencies": [
    "python@3.13",
    "python@3.14"
  ],
  "categories": [
    "parser",
    "library"
  ],
  "caveats": null,
  "conflicts_with": [],
  "dependencies": [],
  "deprecated": 0,
  "deprecation_reason": null,
  "desc": "C parser in Python",
  "disable_reason": null,
  "disabled": 0,
  "enrichment_fetched_at": "2026-06-20T23:40:47+00:00",
  "first_seen": "2026-06-20T23:34:18+00:00",
  "full_name": "pycparser",
  "github_default_branch": "main",
  "github_last_commit_at": "2026-06-08T12:46:50Z",
  "github_readme_excerpt": "===============\npycparser v3.00\n===============\n\n\n.. image:: https://github.com/eliben/pycparser/workflows/pycparser-tests/badge.svg\n  :align: center\n  :target: https://github.com/eliben/pycparser/actions\n\n----\n\n.. contents::\n    :backlinks: none\n\n.. sectnum::\n\nIntroduction\n============\n\nWhat is pycparser?\n------------------\n\n**pycparser** is a parser for the C language, written in pure Python. It is a\nmodule designed to be easily integrated into applications that need to parse\nC source code.\n\nWhat is it good for?\n--------------------\n\nAnything that needs C code to be parsed. The following are some uses for\n**pycparser**, taken from real user reports:\n\n* C code obfuscator\n* Front-end for various specialized C compilers\n* Static code checker\n* Automatic unit-test discovery\n* Adding specialized extensions to the C language\n\nOne of the most popular uses of **pycparser** is in the `cffi\n\u003chttps://cffi.readthedocs.io/en/latest/\u003e`_ library, which uses it to parse the\ndeclarations of C functions and types in order to auto-generate FFIs.\n\n**pycparser** is unique in the sense that it\u0027s written in pure Python - a very\nhigh level language that\u0027s easy to experiment with and tweak. To people familiar\nwith Lex and Yacc, **pycparser**\u0027s code will be simple to understand. It also\nhas no external dependencies (except for a Python interpreter), making it very\nsimple to install and deploy.\n\nWhich version of C does pycparser support?\n------------------------------------------\n\n**pycparser** aims to support the full C99 language (according to the standard\nISO/IEC 9899). Some features from C11 are also supported, and patches to support\nmore are welcome.\n\n**pycparser** supports very few GCC extensions, but it\u0027s fairly easy to set\nthings up so that it parses code with a lot of GCC-isms successfully. See the\n`FAQ \u003chttps://github.com/eliben/pycparser/wiki/FAQ\u003e`_ for more details.\n\nWhat grammar does pycparser follow?\n-----------------------------------\n\n**pycparser** very closely follows the C",
  "github_repo": "eliben/pycparser",
  "github_stars": 3546,
  "github_topics": [],
  "homepage": "https://github.com/eliben/pycparser",
  "homepage_og_description": null,
  "homepage_og_image": null,
  "homepage_title": null,
  "installs_30d": 14195,
  "installs_365d": 245151,
  "installs_90d": 54694,
  "keg_only": 0,
  "keg_only_reason": null,
  "last_seen": "2026-06-20T23:34:18+00:00",
  "license": "BSD-3-Clause",
  "llm_generated_at": "2026-06-20T23:43:58+00:00",
  "llm_model": "claude-haiku-4-5",
  "name": "pycparser",
  "oldnames": [],
  "one_liner": "Pure-Python C language parser, commonly used by cffi and code analysis tools.",
  "optional_dependencies": [],
  "rank_30d": 293,
  "rank_365d": 249,
  "rank_90d": 260,
  "raw_hash": "79ffaf79c10cb250",
  "recommended_dependencies": [],
  "revision": 0,
  "ruby_source_path": "Formula/p/pycparser.rb",
  "tap": "homebrew/core",
  "test_dependencies": [
    "python@3.13",
    "python@3.14"
  ],
  "uses_from_macos": [],
  "version_head": null,
  "version_stable": "3.0",
  "versioned_formulae": [],
  "why_use_this": "pycparser lets you parse C code from Python without external dependencies, making it ideal for building linters, code generators, obfuscators, or FFI tools. It\u0027s the engine behind cffi\u0027s C declaration parsing and popular in static analysis. Choose it when you need programmatic C AST access from Python and can tolerate the speed tradeoff versus C-based parsers."
}