Home

isort

Isort is an open-source Python utility that automatically sorts imports within Python files. Its goal is to enforce a consistent import order and grouping, improving readability and reducing merge conflicts. Isort can organize imports into sections such as standard library, third-party packages, and local application modules, and can enforce blank lines between groups. It can also combine from-imports from the same module and order within groups, according to configurable rules or profiles.

Isort is configurable via configuration files (for example pyproject.toml, setup.cfg, .isort.cfg, or tox.ini) and supports various

Isort is maintained as an open-source project on platforms like GitHub and PyPI, and is widely adopted

options
such
as
line
length,
known
third-party
and
first-party
packages,
and
profiles
(notably,
a
profile
compatible
with
Black).
It
can
be
run
from
the
command
line
to
sort
imports
in
a
single
file,
multiple
files,
or
whole
directories.
It
can
modify
files
in
place,
or
run
in
check-only
or
diff
mode
to
show
what
would
change.
It
also
supports
integration
with
editors
and
with
pre-commit
hooks,
enabling
automatic
sorting
as
part
of
development
workflows.
in
Python
projects
as
part
of
linting
and
formatting
toolchains.
By
standardizing
imports,
it
helps
teams
maintain
consistency
without
manual
intervention.