isort
Python import sorter and organizer
TLDR
Sort imports in file
SYNOPSIS
isort [options] [path...]
DESCRIPTION
isort sorts Python imports alphabetically and automatically separates them into sections following PEP 8 guidelines. It groups imports into standard library, third-party, and local application sections with blank lines between each group.
The tool integrates with popular formatters like Black through profiles, and can be used in editor plugins, pre-commit hooks, and CI pipelines to enforce consistent import ordering across a codebase.
PARAMETERS
--check-only
Check without modifying.--diff
Show changes as diff.--profile NAME
Use predefined profile (black, django, pycharm).-l LENGTH
Line length limit.--force-single-line
One import per line.--skip GLOB
Skip files matching pattern.--help
Display help information.
CONFIGURATION
pyproject.toml `[tool.isort]`
Preferred configuration location. Supports all isort settings including profile, linelength, and knownthird_party.setup.cfg `[isort]`
Alternative configuration in setup.cfg format..isort.cfg
Dedicated isort configuration file, searched in the project root.
CAVEATS
Python-specific. May conflict with other formatters without proper profile configuration. Use profiles for compatibility with Black or other tools.
HISTORY
isort was created by Timothy Crosley to automatically sort and organize Python imports following best practices.
