import-linter
Lint your Python architecture
What it is and what it does
Import Linter is a linting tool that lets you define and enforce rules about which Python modules can import from which other modules. Instead of discovering architectural violations at runtime or code review, you declare your intended module boundaries upfront—for example, 'domain logic must not import from UI'—and the linter checks your codebase against those rules. It's useful for maintaining clean separation of concerns in larger projects.
Beyond the command-line linter, it includes a browser-based interface for exploring your package's import graph interactively. The tool depends on click for CLI handling, grimp for import graph analysis, rich for terminal output formatting, tomli for configuration parsing, and typing-extensions for type hints. It requires Python 3.10 or later and runs on Windows, POSIX, and Unix systems.
Use it for:
- Enforce layered architecture rules (e.g., controllers cannot import from models directly) in a web framework project.
- Prevent circular dependencies by declaring which modules are allowed to depend on which others.
- Visualize and explore the import graph of an unfamiliar Python package to understand its structure.
- Integrate import linting into CI/CD pipelines to catch architectural violations before merge.
- Document intended module boundaries as executable constraints rather than prose guidelines.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Import Linter enforces architectural constraints on Python module imports and provides a browser-based UI for visualizing package architecture.
Yes. Import Linter is production-stable, actively maintained, has no known vulnerabilities, and solves a real problem—keeping Python module dependencies clean and intentional. The low install friction and permissive license make it a straightforward addition to any project that values architectural clarity. Install it if you want to enforce import rules or explore package structure.
Install
import-linter on PyPI
pip
pip install import-linteruv
uv add import-linterpoetry
poetry add import-linterInstalling import-linter
Before you install
Low friction installation with a pure-Python wheel and minimal dependencies. Active maintenance with a recent release (42 days ago) and steady community interest (1135 stars).
License in practice
BSD 2-Clause License is permissive; you can use, modify, and distribute this package with minimal restrictions, provided you include the license text.
Quickstart
pip install import-linter
import_linter lint
Requires Python 3.10 or later.
Verify before relying
- Whether the browser UI requires additional system dependencies or a running server process beyond the CLI.
- Performance characteristics when analyzing large Python codebases or deeply nested package structures.
Package facts
| License | BSD 2-Clause License (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 5 — click, grimp, rich, tomli, typing-extensions |
| Maintenance | actively maintained — 42 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 13,487,925/month — #1,279 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: import_linter-2.13-py3-none-any.whl
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
PyTestArchPyTestArch lets you define and test…
permissive · top 15,000 on PyPI
tachTach enforces module boundaries, dependency…
permissive · top 5,000 on PyPI
pytest-archonPytest-archon lets you define and test…
permissive · top 15,000 on PyPI
lintrunnerLintrunner orchestrates and runs multiple…
unclear · top 5,000 on PyPI
pysenOrchestrates multiple Python linters (black,…
permissive · top 5,000 on PyPI
gitlint-coreLints Git commit messages against configurable…
permissive · top 5,000 on PyPI
grimpGrimp builds a queryable graph of Python…
permissive · top 5,000 on PyPI
lintrunner-adaptersProvides adapter integrations for lintrunner,…
permissive · top 5,000 on PyPI
pylint-quotesA Pylint plugin that enforces consistent use of…
permissive · top 15,000 on PyPI
strict-kwargsA standalone CLI linter that enforces keyword…
permissive · top 15,000 on PyPI