grimp
Builds a queryable graph of the imports within one or more Python packages.
Decision gist · record as of 2026-08-14
Yes. Grimp is actively maintained, has no known vulnerabilities, uses a permissive license, and solves a specific problem—understanding Python package import structure—that has no obvious built-in alternative. The medium install friction is standard for compiled packages and poses no real barrier. Install it if you need to analyze or audit module dependencies in Python code.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.10 or later; the target package must be installed before building its graph.
- Medium install friction due to compiled wheels for multiple platforms and Python versions (3.10–3.14).
- Last release 42 days ago; repository is active with 129 stars and recent commits.
License · maintenance · safety
BSD 2-Clause License (permissive) — BSD 2-Clause License is permissive; you may use, modify, and distribute grimp with minimal restrictions, provided you retain the license notice.
last release 2026-07-03 (42 days) · last repo commit 2026-08-07 · 129 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 14,311,547 downloads/mo, #1,237 on PyPI
Alternatives
Verify before relying
pip install grimp
import grimp
graph = grimp.build_graph('somepackage')
children = graph.find_children('somepackage.foo')
upstream = graph.find_upstream_modules('somepackage.foo')- Performance characteristics on large codebases (number of modules or import depth limits).
- Whether the graph API supports filtering or excluding specific import types (e.g., conditional imports).
- Behavior when analyzing packages with circular imports or dynamic imports.
What it is and what it does
Grimp is a Python import graph builder that constructs a queryable representation of how modules within one or more packages import each other. It parses the installed package code and builds a directed graph where nodes are modules and edges represent import relationships. You use it to answer questions like 'what does this module import', 'what imports this module', and 'what is the shortest import chain between two modules'.
The package supports analyzing single packages, multiple packages together, and namespace packages. By default it excludes external dependencies, but you can include them to see the full import picture including third-party libraries. It returns import details including line numbers and the actual import statements, making it useful for code audits, refactoring, and understanding package architecture.
Use it for
- Audit a package's internal structure to identify circular dependencies or tightly coupled modules.
- Find the shortest import path between two modules to understand coupling depth.
- Trace which modules depend on a specific internal API before refactoring it.
- Analyze namespace packages to understand how portions are distributed and imported.
- Generate import statistics for code quality reports or architecture documentation.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Grimp is actively maintained, has no known vulnerabilities, uses a permissive license, and solves a specific problem—understanding Python package import structure—that has no obvious built-in alternative. The medium install friction is standard for compiled packages and poses no real barrier. Install it if you need to analyze or audit module dependencies in Python code.
Install
grimp on PyPI
Before you install
Medium install friction due to compiled wheels for multiple platforms and Python versions (3.10–3.14). Last release 42 days ago; repository is active with 129 stars and recent commits.
Requires Python 3.10 or later; the target package must be installed before building its graph.
License in practice
BSD 2-Clause License is permissive; you may use, modify, and distribute grimp with minimal restrictions, provided you retain the license notice.
Quickstart
pip install grimp
import grimp
graph = grimp.build_graph('somepackage')
children = graph.find_children('somepackage.foo')
upstream = graph.find_upstream_modules('somepackage.foo')
Verify before relying
- Performance characteristics on large codebases (number of modules or import depth limits).
- Whether the graph API supports filtering or excluding specific import types (e.g., conditional imports).
- Behavior when analyzing packages with circular imports or dynamic imports.
Package facts
| License | BSD 2-Clause License permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 42 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 14,311,547 / month, #1,237 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: Microsoft :: WindowsOperating System :: POSIXOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonProgramming Language :: RustTopic :: Utilities |
Evidence: grimp-3.15-cp310-cp310-macosx_10_12_x86_64.whl; grimp-3.15-cp310-cp310-macosx_11_0_arm64.whl; grimp-3.15-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; grimp-3.15-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl; grimp-3.15-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl; grimp-3.15-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl; grimp-3.15-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl; grimp-3.15-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; grimp-3.15-cp310-cp310-musllinux_1_2_aarch64.whl; grimp-3.15-cp310-cp310-musllinux_1_2_armv7l.whl; grimp-3.15-cp310-cp310-musllinux_1_2_i686.whl; grimp-3.15-cp310-cp310-musllinux_1_2_x86_64.whl; grimp-3.15-cp310-cp310-win32.whl; grimp-3.15-cp310-cp310-win_amd64.whl; grimp-3.15-cp311-cp311-macosx_10_12_x86_64.whl; grimp-3.15-cp311-cp311-macosx_11_0_arm64.whl; grimp-3.15-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; grimp-3.15-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl; grimp-3.15-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl; grimp-3.15-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “find import chains”
- grimpGrimp builds a queryable graph of Python package imports, letting you…
- benigetBeniget performs compile-time analysis on Python abstract syntax…
- findsparkAdds Spark to Python's import path at runtime, making it available as…
Give your agent the search over MCP, or paste the wish link into any chat.
More Utilities packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.
Install it if you need to display or transform source code.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
See also modulegraph · apipkg · pydeps · import-linter · pyan3 · ipynb · py-import-cycles · modulegraph2 · import-deps · tach