--- id: import-linter version: "2.13" license: BSD 2-Clause License license_treatment: permissive maintenance: active --- # import-linter — Lint your Python architecture License: permissive · Maintenance: active · Downloads: 13.5M/mo ## 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 above — 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 pip install import-linter uv add import-linter 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_current - Install friction: low - Maintenance: active - Downloads: 13.5M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags python import constraints, architecture linting, module dependency rules, python code structure validation, import graph visualization, enforce import policies, python architecture explorer, architecture-validation, import-graph, code-quality [View on SkillFed](https://skillfed.io/packages/import-linter) · [View on PyPI](https://pypi.org/project/import-linter/)