{"categories":[{"label":"Software Development","url":"https://skillfed.io/packages/category/software-development/6"}],"enrichment":{"capability":"Beniget performs compile-time analysis on Python abstract syntax trees, extracting semantic information like definition-use chains, use-definition chains, and ancestor relationships to support static analysis and code transformation tools.","skillfed_tags":["ast-analysis","static-analysis","compiler-tools"],"use_cases":["Detect unused imports and dead code by analyzing definition-use chains at module scope.","Find all functions decorated with a specific decorator by traversing decorator uses and their parent nodes.","Gather all attributes assigned to self in a class by walking method parameters and attribute accesses.","Compute identifiers captured by inner functions and lambdas from outer scopes.","Trace the set of statements required to compute a function by combining use-def chains with ancestor analysis."],"what_it_does":"Beniget is a static analysis library that extracts semantic information from Python abstract syntax trees. It provides three main analyses: Ancestors (maps each node to its enclosing nodes), DefUseChains (maps definitions to their uses), and UseDefChains (maps uses back to their definitions). It works across Python 3.6+ by relying on gast for cross-version AST abstraction, and as of version 0.5.0 also supports the standard library ast module.\n\nThe library is designed as a building block for writing static analyzers, compilers, and code transformation tools. Common use cases include detecting unused imports, finding decorated functions, gathering class attributes, computing variable capture in closures, and tracing instruction dependencies. It handles the semantic complexity of Python's scoping rules and name binding, though it cannot track dynamic lookups through eval() or globals().","worth_installing":"Yes. Beniget is a solid, actively maintained library for static Python code analysis with low install friction and no known vulnerabilities. It fills a specific niche\u2014semantic AST analysis\u2014and is well-suited for anyone building linters, compilers, or code transformation tools. The permissive BSD license poses no barrier. Install it if you need to reason about Python code structure and data flow."},"id":"beniget","links":{"html":"https://skillfed.io/packages/beniget","md":"https://skillfed.io/packages/beniget.md","pypi":"https://pypi.org/project/beniget/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2025-11-29","license_spdx":null,"license_treatment":"permissive","name":"beniget","python_support":"supports_current","summary":"Extract semantic information about static Python code"},"popularity":{"monthly_downloads":802315,"position":5020,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.5.0"}
