skillfed

import-linter

Lint your Python architecture

import-linter v2.13 13.5M downloads/30d#1,279 on PyPI1,135
Permissive license BSD 2-Clause License Active released

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-linter

uv

uv add import-linter

poetry

poetry add import-linter

Installing 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

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 :: CPythonTopic :: Utilities

Tags

python import constraintsarchitecture lintingmodule dependency rulespython code structure validationimport graph visualizationenforce import policiespython architecture explorer
architecture-validationimport-graphcode-quality

More Utilities packages