{"id":24460,"library":"python-scalpel","title":"Scalpel","description":"Scalpel is a Python program analysis framework for building static analysis tools (e.g., call graph extraction, type inference, SSA construction). The current version is 1.0b0 (pre-release beta). Release cadence is irregular; last updated 2022.","status":"active","version":"1.0b0","language":"python","source_language":"en","source_url":"https://github.com/SMAT-Lab/Scalpel","tags":["static analysis","program analysis","call graph","code analysis"],"install":[{"cmd":"pip install python-scalpel","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Package name is 'scalpel', not 'python_scalpel' or 'python-scalpel'.","wrong":"from python_scalpel import Scalpel","symbol":"Scalpel","correct":"from scalpel import Scalpel"},{"note":"","wrong":"","symbol":"CallGraph","correct":"from scalpel.call_graph import CallGraph"},{"note":"","wrong":"","symbol":"CFG","correct":"from scalpel.cfg import CFG"}],"quickstart":{"code":"from scalpel import Scalpel\nfrom scalpel.call_graph import CallGraph\n\nscalpel = Scalpel('path/to/script.py')\ncall_graph = scalpel.analyze_call_graph()\nprint(call_graph.nodes, call_graph.edges)","lang":"python","description":"Analyze a Python file and extract its call graph."},"warnings":[{"fix":"Pin to exact version and test thoroughly.","message":"Scalpel is still in beta (1.0b0); API is unstable and may change without notice.","severity":"gotcha","affected_versions":"<=1.0b0"},{"fix":"Use `from scalpel import Scalpel`.","message":"The old import path `scalpel.core.Scalpel` has been removed; use `scalpel.Scalpel` directly.","severity":"deprecated","affected_versions":">=0.8.0"},{"fix":"Prefer Python 3.8 or 3.9 for production use.","message":"Python 3.10+ support is experimental; some AST nodes may not be handled correctly.","severity":"breaking","affected_versions":">=1.0b0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"pip install python-scalpel; then import scalpel.","cause":"Package is installed as 'python-scalpel' but import name is 'scalpel'.","error":"ModuleNotFoundError: No module named 'scalpel'"},{"fix":"Use `from scalpel import Scalpel`.","cause":"Old import path used (e.g., `from scalpel.core import Scalpel`) or scalpel not installed.","error":"AttributeError: module 'scalpel' has no attribute 'Scalpel'"},{"fix":"Use `from scalpel import Scalpel` then `Scalpel(...)`.","cause":"Importing `scalpel` but trying to instantiate it as a class.","error":"TypeError: 'module' object is not callable"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}