---
name: "isort"
section: "1"
platform: "linux"
package: "isort"
version: "6.0.1-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/isort"
---

# isort(1)

program for sorting Python import definitions

## NAME

isort - program for sorting Python import definitions

## SYNOPSIS

**isort** \[**-h**\] \[**-l** *LINE\_LENGTH*\] \[**-s** *SKIP*\] \[**-ns** *NOT\_SKIP*\] \[**-t** *FORCE\_TO\_TOP*\] \[**-b** *KNOWN\_STANDARD\_LIBRARY*\] \[**-o** *KNOWN\_THIRD\_PARTY*\] \[**-p** *KNOWN\_FIRST\_PARTY*\] \[**-m** *MODE*\] \[**-i** *INDENT*\] \[**-a** *ADD\_IMPORTS*\] \[**-af**\] \[**-r** *REMOVE\_IMPORTS*\] \[**-ls**\] \[**-d**\] \[**-c**\] \[**-sl**\] \[**-sd** *DEFAULT\_SECTION*\] \[**-df**\] \[**-e**\] \[**-rc**\] \[**-ot**\] \[**-ac**\] \[**-cs**\] \[**-v**\] \[**-vb**\] \[**-sp** *SETTINGS\_PATH*\] *file*...

## DESCRIPTION

**isort** sorts Python import definitions alphabetically within logical sections.

## OPTIONS

- **-h**, **--help**

  show this help message and exit

- **-l** *LINE\_LENGTH*, **--lines** *LINE\_LENGTH*

  The maximum length of an import line (used for wrapping long imports).

- **-s** *SKIP*, **--skip** *SKIP*

  Files that sort imports should skip over.

- **-ns** *NOT\_SKIP*, **--dont-skip** *NOT\_SKIP*

  Files that sort imports should never skip over.

- **-t** *FORCE\_TO\_TOP,* **--top** *FORCE\_TO\_TOP*

  Force specific imports to the top of their appropriate section.

- **-b** *KNOWN\_STANDARD\_LIBRARY*, **--builtin** *KNOWN\_STANDARD\_LIBRARY*

  Force isort to recognize a module as part of the python standard library.

- **-o** *KNOWN\_THIRD\_PARTY*, **--thirdparty** *KNOWN\_THIRD\_PARTY*

  Force isort to recognize a module as being part of a third party library.

- **-p** *KNOWN\_FIRST\_PARTY*, **--project** *KNOWN\_FIRST\_PARTY*

  Force isort to recognize a module as being part of the current python project.

- **-m** *MODE*, **--multi\_line** *MODE*

  Multi line output (0=grid, 1=vertical, 2=hanging, 3=vert-hanging, 4=vert-grid, 5=vert-grid-grouped).

- **-i** *INDENT*, **--indent** *INDENT*

  String to place for indents; defaults to "    " (4 spaces).

- **-a** *ADD\_IMPORTS*, **--add\_import** *ADD\_IMPORTS*

  Adds the specified import line to all files, automatically determining correct placement.

- **-af**, **--force\_adds**

  Forces import adds even if the original file is empty.

- **-r** *REMOVE\_IMPORTS*, **--remove\_import** *REMOVE\_IMPORTS*

  Removes the specified import from all files.

- **-ls**, **--length\_sort**

  Sort imports by their string length.

- **-d**, **--stdout**

  Force resulting output to stdout, instead of in-place.

- **-c**, **--check-only**

  Checks the file for unsorted imports and prints them to the command line without modifying the file.

- **-sl**, **--force\_single\_line\_imports**

  Forces all from imports to appear on their own line.

- **-sd** *DEFAULT\_SECTION*, **--section-default** *DEFAULT\_SECTION*

  Sets the default section for imports (by default, *FIRSTPARTY*). Possible values: *FUTURE*, *ISTDLIB*, *THIRDPARTY*, *FIRSTPARTY*, *LOCALFOLDER*

- **-df**, **--diff**

  Prints a diff of all the changes isort would make to a file, instead of changing it in place

- **-e**, **--balanced**

  Balances wrapping to produce the most consistent line length possible.

- **-rc**, **--recursive**

  Recursively look for Python files of which to sort imports.

- **-ot**, **--order-by-type**

  Order imports by type in addition to alphabetically.

- **-ac**, **--atomic**

  Ensures the output doesn't save if the resulting file contains syntax errors.

- **-cs**, **--combine-star**

  Ensures that if a star import is present, nothing else is imported from that namespace.

- **-v**, **--version**

  Show program's version number and exit.

- **-vb**, **--verbose**

  Shows verbose output, such as when files are skipped or when a check is successful.

- **-sp** *SETTINGS\_PATH*, **--settings-path** *SETTINGS\_PATH*

  Explicitly set the settings path instead of auto determining based on file location.
