| 1 |
.\" generated by help2man 1.49.3. |
| 2 |
.TH ISORT "1" "February 2025" "isort 6.0.0" "User Commands" |
| 3 |
.SH NAME |
| 4 |
isort \- sort Python import definitions |
| 5 |
.SH DESCRIPTION |
| 6 |
usage: isort [\-h] [\-V] [\-\-vn] [\-v] [\-\-only\-modified] [\-\-dedup\-headings] [\-q] |
| 7 |
.IP |
| 8 |
[\-d] [\-\-overwrite\-in\-place] [\-\-show\-config] [\-\-show\-files] [\-\-df] |
| 9 |
[\-c] [\-\-ws] [\-\-sp SETTINGS_PATH] [\-\-cr CONFIG_ROOT] |
| 10 |
[\-\-resolve\-all\-configs] [\-\-profile PROFILE] [\-\-old\-finders] |
| 11 |
[\-j [JOBS]] [\-\-ac] [\-\-interactive] [\-\-format\-error FORMAT_ERROR] |
| 12 |
[\-\-format\-success FORMAT_SUCCESS] [\-\-srx] [\-\-filter\-files] |
| 13 |
[\-s SKIP] [\-\-extend\-skip EXTEND_SKIP] [\-\-sg SKIP_GLOB] |
| 14 |
[\-\-extend\-skip\-glob EXTEND_SKIP_GLOB] [\-\-gitignore] |
| 15 |
[\-\-ext SUPPORTED_EXTENSIONS] |
| 16 |
[\-\-blocked\-extension BLOCKED_EXTENSIONS] [\-\-dont\-follow\-links] |
| 17 |
[\-\-filename FILENAME] [\-\-allow\-root] [\-a ADD_IMPORTS] [\-\-append] |
| 18 |
[\-\-af] [\-\-rm REMOVE_IMPORTS] [\-\-float\-to\-top] |
| 19 |
[\-\-dont\-float\-to\-top] [\-\-ca] [\-\-cs] [\-e] [\-\-ff] |
| 20 |
[\-\-fgw [FORCE_GRID_WRAP]] [\-i INDENT] |
| 21 |
[\-\-lbi LINES_BEFORE_IMPORTS] [\-\-lai LINES_AFTER_IMPORTS] |
| 22 |
[\-\-lbt LINES_BETWEEN_TYPES] [\-\-le LINE_ENDING] [\-\-ls] [\-\-lss] |
| 23 |
[\-m {GRID,VERTICAL,HANGING_INDENT,VERTICAL_HANGING_INDENT,VERTICAL_GRID,VERTICAL_GRID_GROUPED,VERTICAL_GRID_GROUPED_NO_COMMA,NOQA,VERTICAL_HANGING_INDENT_BRACKET,VERTICAL_PREFIX_FROM_MODULE_IMPORT,HANGING_INDENT_WITH_PARENTHESES,BACKSLASH_GRID,0,1,2,3,4,5,6,7,8,9,10,11}] |
| 24 |
[\-n] [\-\-nis] [\-\-ot] [\-\-dt] [\-\-rr] [\-\-reverse\-sort] |
| 25 |
[\-\-sort\-order SORT_ORDER] [\-\-sl] [\-\-nsl SINGLE_LINE_EXCLUSIONS] |
| 26 |
[\-\-tc] [\-\-up] [\-l LINE_LENGTH] [\-\-wl WRAP_LENGTH] |
| 27 |
[\-\-case\-sensitive] [\-\-remove\-redundant\-aliases] [\-\-honor\-noqa] |
| 28 |
[\-\-treat\-comment\-as\-code TREAT_COMMENTS_AS_CODE] |
| 29 |
[\-\-treat\-all\-comment\-as\-code] [\-\-formatter FORMATTER] [\-\-color] |
| 30 |
[\-\-ext\-format EXT_FORMAT] [\-\-star\-first] |
| 31 |
[\-\-split\-on\-trailing\-comma] [\-\-sd DEFAULT_SECTION] |
| 32 |
[\-\-only\-sections] [\-\-ds] [\-\-fas] [\-\-fss] [\-\-hcss] [\-\-srss] |
| 33 |
[\-\-fass] [\-t FORCE_TO_TOP] [\-\-combine\-straight\-imports] |
| 34 |
[\-\-nlb NO_LINES_BEFORE] [\-\-src SRC_PATHS] |
| 35 |
[\-b KNOWN_STANDARD_LIBRARY] |
| 36 |
[\-\-extra\-builtin EXTRA_STANDARD_LIBRARY] |
| 37 |
[\-f KNOWN_FUTURE_LIBRARY] [\-o KNOWN_THIRD_PARTY] |
| 38 |
[\-p KNOWN_FIRST_PARTY] [\-\-known\-local\-folder KNOWN_LOCAL_FOLDER] |
| 39 |
[\-\-virtual\-env VIRTUAL_ENV] [\-\-conda\-env CONDA_ENV] |
| 40 |
[\-\-py {all,2,27,3,310,311,312,313,36,37,38,39,auto}] |
| 41 |
[files ...] |
| 42 |
.PP |
| 43 |
Sort Python import definitions alphabetically within logical sections. Run |
| 44 |
with no arguments to see a quick start guide, otherwise, one or more |
| 45 |
files/directories/stdin must be provided. Use `\-` as the first argument to |
| 46 |
represent stdin. Use \fB\-\-interactive\fR to use the pre 5.0.0 interactive behavior. |
| 47 |
If you've used isort 4 but are new to isort 5, see the upgrading guide: |
| 48 |
https://pycqa.github.io/isort/docs/upgrade_guides/5.0.0.html |
| 49 |
.SS "general options:" |
| 50 |
.TP |
| 51 |
\fB\-h\fR, \fB\-\-help\fR |
| 52 |
show this help message and exit |
| 53 |
.TP |
| 54 |
\fB\-V\fR, \fB\-\-version\fR |
| 55 |
Displays the currently installed version of isort. |
| 56 |
.TP |
| 57 |
\fB\-\-vn\fR, \fB\-\-version\-number\fR |
| 58 |
Returns just the current version number without the |
| 59 |
logo |
| 60 |
.TP |
| 61 |
\fB\-v\fR, \fB\-\-verbose\fR |
| 62 |
Shows verbose output, such as when files are skipped |
| 63 |
or when a check is successful. |
| 64 |
.TP |
| 65 |
\fB\-\-only\-modified\fR, \fB\-\-om\fR |
| 66 |
Suppresses verbose output for non\-modified files. |
| 67 |
.TP |
| 68 |
\fB\-\-dedup\-headings\fR |
| 69 |
Tells isort to only show an identical custom import |
| 70 |
heading comment once, even if there are multiple |
| 71 |
sections with the comment set. |
| 72 |
.TP |
| 73 |
\fB\-q\fR, \fB\-\-quiet\fR |
| 74 |
Shows extra quiet output, only errors are outputted. |
| 75 |
.TP |
| 76 |
\fB\-d\fR, \fB\-\-stdout\fR |
| 77 |
Force resulting output to stdout, instead of in\-place. |
| 78 |
.TP |
| 79 |
\fB\-\-overwrite\-in\-place\fR |
| 80 |
Tells isort to overwrite in place using the same file |
| 81 |
handle. Comes at a performance and memory usage |
| 82 |
penalty over its standard approach but ensures all |
| 83 |
file flags and modes stay unchanged. |
| 84 |
.TP |
| 85 |
\fB\-\-show\-config\fR |
| 86 |
See isort's determined config, as well as sources of |
| 87 |
config options. |
| 88 |
.TP |
| 89 |
\fB\-\-show\-files\fR |
| 90 |
See the files isort will be run against with the |
| 91 |
current config options. |
| 92 |
.TP |
| 93 |
\fB\-\-df\fR, \fB\-\-diff\fR |
| 94 |
Prints a diff of all the changes isort would make to a |
| 95 |
file, instead of changing it in place |
| 96 |
.TP |
| 97 |
\fB\-c\fR, \fB\-\-check\-only\fR, \fB\-\-check\fR |
| 98 |
Checks the file for unsorted / unformatted imports and |
| 99 |
prints them to the command line without modifying the |
| 100 |
file. Returns 0 when nothing would change and returns |
| 101 |
1 when the file would be reformatted. |
| 102 |
.TP |
| 103 |
\fB\-\-ws\fR, \fB\-\-ignore\-whitespace\fR |
| 104 |
Tells isort to ignore whitespace differences when |
| 105 |
\fB\-\-check\-only\fR is being used. |
| 106 |
.TP |
| 107 |
\fB\-\-sp\fR, \fB\-\-settings\-path\fR, \fB\-\-settings\-file\fR, \fB\-\-settings\fR SETTINGS_PATH |
| 108 |
Explicitly set the settings path or file instead of |
| 109 |
auto determining based on file location. |
| 110 |
.TP |
| 111 |
\fB\-\-cr\fR, \fB\-\-config\-root\fR CONFIG_ROOT |
| 112 |
Explicitly set the config root for resolving all |
| 113 |
configs. When used with the \fB\-\-resolve\-all\-configs\fR |
| 114 |
flag, isort will look at all sub\-folders in this |
| 115 |
config root to resolve config files and sort files |
| 116 |
based on the closest available config(if any) |
| 117 |
.TP |
| 118 |
\fB\-\-resolve\-all\-configs\fR |
| 119 |
Tells isort to resolve the configs for all subdirectories and sort files in terms of its closest |
| 120 |
config files. |
| 121 |
.TP |
| 122 |
\fB\-\-profile\fR PROFILE |
| 123 |
Base profile type to use for configuration. Profiles |
| 124 |
include: black, django, pycharm, google, open_stack, |
| 125 |
plone, attrs, hug, wemake, appnexus. As well as any |
| 126 |
shared profiles. |
| 127 |
.TP |
| 128 |
\fB\-\-old\-finders\fR, \fB\-\-magic\-placement\fR |
| 129 |
Use the old deprecated finder logic that relies on |
| 130 |
environment introspection magic. |
| 131 |
.TP |
| 132 |
\fB\-j\fR, \fB\-\-jobs\fR [JOBS] |
| 133 |
Number of files to process in parallel. Negative value |
| 134 |
means use number of CPUs. |
| 135 |
.TP |
| 136 |
\fB\-\-ac\fR, \fB\-\-atomic\fR |
| 137 |
Ensures the output doesn't save if the resulting file |
| 138 |
contains syntax errors. |
| 139 |
.TP |
| 140 |
\fB\-\-interactive\fR |
| 141 |
Tells isort to apply changes interactively. |
| 142 |
.TP |
| 143 |
\fB\-\-format\-error\fR FORMAT_ERROR |
| 144 |
Override the format used to print errors. |
| 145 |
.TP |
| 146 |
\fB\-\-format\-success\fR FORMAT_SUCCESS |
| 147 |
Override the format used to print success. |
| 148 |
.TP |
| 149 |
\fB\-\-srx\fR, \fB\-\-sort\-reexports\fR |
| 150 |
Automatically sort all re\-exports (module level |
| 151 |
__all__ collections) |
| 152 |
.SS "target options:" |
| 153 |
.TP |
| 154 |
files |
| 155 |
One or more Python source files that need their |
| 156 |
imports sorted. |
| 157 |
.TP |
| 158 |
\fB\-\-filter\-files\fR |
| 159 |
Tells isort to filter files even when they are |
| 160 |
explicitly passed in as part of the CLI command. |
| 161 |
.TP |
| 162 |
\fB\-s\fR, \fB\-\-skip\fR SKIP |
| 163 |
Files that isort should skip over. If you want to skip |
| 164 |
multiple files you should specify twice: \fB\-\-skip\fR file1 |
| 165 |
\fB\-\-skip\fR file2. Values can be file names, directory |
| 166 |
names or file paths. To skip all files in a nested |
| 167 |
path use \fB\-\-skip\-glob\fR. |
| 168 |
.TP |
| 169 |
\fB\-\-extend\-skip\fR EXTEND_SKIP |
| 170 |
Extends \fB\-\-skip\fR to add additional files that isort |
| 171 |
should skip over. If you want to skip multiple files |
| 172 |
you should specify twice: \fB\-\-skip\fR file1 \fB\-\-skip\fR file2. |
| 173 |
Values can be file names, directory names or file |
| 174 |
paths. To skip all files in a nested path use \fB\-\-skipglob\fR. |
| 175 |
.TP |
| 176 |
\fB\-\-sg\fR, \fB\-\-skip\-glob\fR SKIP_GLOB |
| 177 |
Files that isort should skip over. |
| 178 |
.TP |
| 179 |
\fB\-\-extend\-skip\-glob\fR EXTEND_SKIP_GLOB |
| 180 |
Additional files that isort should skip over |
| 181 |
(extending \fB\-\-skip\-glob\fR). |
| 182 |
.TP |
| 183 |
\fB\-\-gitignore\fR, \fB\-\-skip\-gitignore\fR |
| 184 |
Treat project as a git repository and ignore files |
| 185 |
listed in .gitignore. NOTE: This requires git to be |
| 186 |
installed and accessible from the same shell as isort. |
| 187 |
.TP |
| 188 |
\fB\-\-ext\fR, \fB\-\-extension\fR, \fB\-\-supported\-extension\fR SUPPORTED_EXTENSIONS |
| 189 |
Specifies what extensions isort can be run against. |
| 190 |
.TP |
| 191 |
\fB\-\-blocked\-extension\fR BLOCKED_EXTENSIONS |
| 192 |
Specifies what extensions isort can never be run |
| 193 |
against. |
| 194 |
.TP |
| 195 |
\fB\-\-dont\-follow\-links\fR |
| 196 |
Tells isort not to follow symlinks that are |
| 197 |
encountered when running recursively. |
| 198 |
.TP |
| 199 |
\fB\-\-filename\fR FILENAME |
| 200 |
Provide the filename associated with a stream. |
| 201 |
.TP |
| 202 |
\fB\-\-allow\-root\fR |
| 203 |
Tells isort not to treat / specially, allowing it to |
| 204 |
be run against the root dir. |
| 205 |
.SS "general output options:" |
| 206 |
.TP |
| 207 |
\fB\-a\fR, \fB\-\-add\-import\fR ADD_IMPORTS |
| 208 |
Adds the specified import line to all files, |
| 209 |
automatically determining correct placement. |
| 210 |
.TP |
| 211 |
\fB\-\-append\fR, \fB\-\-append\-only\fR |
| 212 |
Only adds the imports specified in \fB\-\-add\-import\fR if the |
| 213 |
file contains existing imports. |
| 214 |
.TP |
| 215 |
\fB\-\-af\fR, \fB\-\-force\-adds\fR |
| 216 |
Forces import adds even if the original file is empty. |
| 217 |
.TP |
| 218 |
\fB\-\-rm\fR, \fB\-\-remove\-import\fR REMOVE_IMPORTS |
| 219 |
Removes the specified import from all files. |
| 220 |
.TP |
| 221 |
\fB\-\-float\-to\-top\fR |
| 222 |
Causes all non\-indented imports to float to the top of |
| 223 |
the file having its imports sorted (immediately below |
| 224 |
the top of file comment). This can be an excellent |
| 225 |
shortcut for collecting imports every once in a while |
| 226 |
when you place them in the middle of a file to avoid |
| 227 |
context switching. *NOTE*: It currently doesn't work |
| 228 |
with cimports and introduces some extra over\-head and |
| 229 |
a performance penalty. |
| 230 |
.TP |
| 231 |
\fB\-\-dont\-float\-to\-top\fR |
| 232 |
Forces \fB\-\-float\-to\-top\fR setting off. See \fB\-\-float\-to\-top\fR |
| 233 |
for more information. |
| 234 |
.TP |
| 235 |
\fB\-\-ca\fR, \fB\-\-combine\-as\fR |
| 236 |
Combines as imports on the same line. |
| 237 |
.TP |
| 238 |
\fB\-\-cs\fR, \fB\-\-combine\-star\fR |
| 239 |
Ensures that if a star import is present, nothing else |
| 240 |
is imported from that namespace. |
| 241 |
.TP |
| 242 |
\fB\-e\fR, \fB\-\-balanced\fR |
| 243 |
Balances wrapping to produce the most consistent line |
| 244 |
length possible |
| 245 |
.TP |
| 246 |
\fB\-\-ff\fR, \fB\-\-from\-first\fR |
| 247 |
Switches the typical ordering preference, showing from |
| 248 |
imports first then straight ones. |
| 249 |
.TP |
| 250 |
\fB\-\-fgw\fR, \fB\-\-force\-grid\-wrap\fR [FORCE_GRID_WRAP] |
| 251 |
Force number of from imports (defaults to 2 when |
| 252 |
passed as CLI flag without value) to be grid wrapped |
| 253 |
regardless of line length. If 0 is passed in (the |
| 254 |
global default) only line length is considered. |
| 255 |
.TP |
| 256 |
\fB\-i\fR, \fB\-\-indent\fR INDENT |
| 257 |
String to place for indents defaults to " " (4 |
| 258 |
spaces). |
| 259 |
.HP |
| 260 |
\fB\-\-lbi\fR, \fB\-\-lines\-before\-imports\fR LINES_BEFORE_IMPORTS |
| 261 |
.HP |
| 262 |
\fB\-\-lai\fR, \fB\-\-lines\-after\-imports\fR LINES_AFTER_IMPORTS |
| 263 |
.HP |
| 264 |
\fB\-\-lbt\fR, \fB\-\-lines\-between\-types\fR LINES_BETWEEN_TYPES |
| 265 |
.TP |
| 266 |
\fB\-\-le\fR, \fB\-\-line\-ending\fR LINE_ENDING |
| 267 |
Forces line endings to the specified value. If not |
| 268 |
set, values will be guessed per\-file. |
| 269 |
.TP |
| 270 |
\fB\-\-ls\fR, \fB\-\-length\-sort\fR |
| 271 |
Sort imports by their string length. |
| 272 |
.TP |
| 273 |
\fB\-\-lss\fR, \fB\-\-length\-sort\-straight\fR |
| 274 |
Sort straight imports by their string length. Similar |
| 275 |
to `length_sort` but applies only to straight imports |
| 276 |
and doesn't affect from imports. |
| 277 |
.TP |
| 278 |
\fB\-m\fR, \fB\-\-multi\-line\fR {GRID,VERTICAL,HANGING_INDENT,VERTICAL_HANGING_INDENT,VERTICAL_GRID,VERTICAL_GRID_GROUPED,VERTICAL_GRID_GROUPED_NO_COMMA,NOQA,VERTICAL_HANGING_INDENT_BRACKET,VERTICAL_PREFIX_FROM_MODULE_IMPORT,HANGING_INDENT_WITH_PARENTHESES,BACKSLASH_GRID,0,1,2,3,4,5,6,7,8,9,10,11} |
| 279 |
Multi line output (0\-grid, 1\-vertical, 2\-hanging, |
| 280 |
3\-vert\-hanging, 4\-vert\-grid, 5\-vert\-grid\-grouped, |
| 281 |
6\-deprecated\-alias\-for\-5, 7\-noqa, 8\-vertical\-hangingindent\-bracket, 9\-vertical\-prefix\-from\-module\-import, |
| 282 |
10\-hanging\-indent\-with\-parentheses). |
| 283 |
.TP |
| 284 |
\fB\-n\fR, \fB\-\-ensure\-newline\-before\-comments\fR |
| 285 |
Inserts a blank line before a comment following an |
| 286 |
import. |
| 287 |
.TP |
| 288 |
\fB\-\-nis\fR, \fB\-\-no\-inline\-sort\fR |
| 289 |
Leaves `from` imports with multiple imports 'as\-is' |
| 290 |
(e.g. `from foo import a, c ,b`). |
| 291 |
.TP |
| 292 |
\fB\-\-ot\fR, \fB\-\-order\-by\-type\fR |
| 293 |
Order imports by type, which is determined by case, in |
| 294 |
addition to alphabetically. **NOTE**: type here refers |
| 295 |
to the implied type from the import name |
| 296 |
capitalization. isort does not do type introspection |
| 297 |
for the imports. These "types" are simply: |
| 298 |
CONSTANT_VARIABLE, CamelCaseClass, |
| 299 |
variable_or_function. If your project follows PEP8 or |
| 300 |
a related coding standard and has many imports this is |
| 301 |
a good default, otherwise you likely will want to turn |
| 302 |
it off. From the CLI the `\-\-dont\-order\-by\-type` option |
| 303 |
will turn this off. |
| 304 |
.TP |
| 305 |
\fB\-\-dt\fR, \fB\-\-dont\-order\-by\-type\fR |
| 306 |
Don't order imports by type, which is determined by |
| 307 |
case, in addition to alphabetically. **NOTE**: type |
| 308 |
here refers to the implied type from the import name |
| 309 |
capitalization. isort does not do type introspection |
| 310 |
for the imports. These "types" are simply: |
| 311 |
CONSTANT_VARIABLE, CamelCaseClass, |
| 312 |
variable_or_function. If your project follows PEP8 or |
| 313 |
a related coding standard and has many imports this is |
| 314 |
a good default. You can turn this on from the CLI |
| 315 |
using `\-\-order\-by\-type`. |
| 316 |
.TP |
| 317 |
\fB\-\-rr\fR, \fB\-\-reverse\-relative\fR |
| 318 |
Reverse order of relative imports. |
| 319 |
.TP |
| 320 |
\fB\-\-reverse\-sort\fR |
| 321 |
Reverses the ordering of imports. |
| 322 |
.TP |
| 323 |
\fB\-\-sort\-order\fR SORT_ORDER |
| 324 |
Specify sorting function. Can be built in |
| 325 |
(natural[default] = force numbers to be sequential, |
| 326 |
native = Python's built\-in sorted function) or an |
| 327 |
installable plugin. |
| 328 |
.TP |
| 329 |
\fB\-\-sl\fR, \fB\-\-force\-single\-line\-imports\fR |
| 330 |
Forces all from imports to appear on their own line |
| 331 |
.TP |
| 332 |
\fB\-\-nsl\fR, \fB\-\-single\-line\-exclusions\fR SINGLE_LINE_EXCLUSIONS |
| 333 |
One or more modules to exclude from the single line |
| 334 |
rule. |
| 335 |
.TP |
| 336 |
\fB\-\-tc\fR, \fB\-\-trailing\-comma\fR |
| 337 |
Includes a trailing comma on multi line imports that |
| 338 |
include parentheses. |
| 339 |
.TP |
| 340 |
\fB\-\-up\fR, \fB\-\-use\-parentheses\fR |
| 341 |
Use parentheses for line continuation on length limit |
| 342 |
instead of slashes. **NOTE**: This is separate from |
| 343 |
wrap modes, and only affects how individual lines that |
| 344 |
are too long get continued, not sections of multiple |
| 345 |
imports. |
| 346 |
.TP |
| 347 |
\fB\-l\fR, \fB\-w\fR, \fB\-\-line\-length\fR, \fB\-\-line\-width\fR LINE_LENGTH |
| 348 |
The max length of an import line (used for wrapping |
| 349 |
long imports). |
| 350 |
.TP |
| 351 |
\fB\-\-wl\fR, \fB\-\-wrap\-length\fR WRAP_LENGTH |
| 352 |
Specifies how long lines that are wrapped should be, |
| 353 |
if not set line_length is used. NOTE: wrap_length must |
| 354 |
be LOWER than or equal to line_length. |
| 355 |
.TP |
| 356 |
\fB\-\-case\-sensitive\fR |
| 357 |
Tells isort to include casing when sorting module |
| 358 |
names |
| 359 |
.TP |
| 360 |
\fB\-\-remove\-redundant\-aliases\fR |
| 361 |
Tells isort to remove redundant aliases from imports, |
| 362 |
such as `import os as os`. This defaults to `False` |
| 363 |
simply because some projects use these seemingly |
| 364 |
useless aliases to signify intent and change |
| 365 |
behaviour. |
| 366 |
.TP |
| 367 |
\fB\-\-honor\-noqa\fR |
| 368 |
Tells isort to honor noqa comments to enforce skipping |
| 369 |
those comments. |
| 370 |
.TP |
| 371 |
\fB\-\-treat\-comment\-as\-code\fR TREAT_COMMENTS_AS_CODE |
| 372 |
Tells isort to treat the specified single line |
| 373 |
comment(s) as if they are code. |
| 374 |
.TP |
| 375 |
\fB\-\-treat\-all\-comment\-as\-code\fR |
| 376 |
Tells isort to treat all single line comments as if |
| 377 |
they are code. |
| 378 |
.TP |
| 379 |
\fB\-\-formatter\fR FORMATTER |
| 380 |
Specifies the name of a formatting plugin to use when |
| 381 |
producing output. |
| 382 |
.TP |
| 383 |
\fB\-\-color\fR |
| 384 |
Tells isort to use color in terminal output. |
| 385 |
.TP |
| 386 |
\fB\-\-ext\-format\fR EXT_FORMAT |
| 387 |
Tells isort to format the given files according to an |
| 388 |
extensions formatting rules. |
| 389 |
.TP |
| 390 |
\fB\-\-star\-first\fR |
| 391 |
Forces star imports above others to avoid overriding |
| 392 |
directly imported variables. |
| 393 |
.TP |
| 394 |
\fB\-\-split\-on\-trailing\-comma\fR |
| 395 |
Split imports list followed by a trailing comma into |
| 396 |
VERTICAL_HANGING_INDENT mode |
| 397 |
.SS "section output options:" |
| 398 |
.TP |
| 399 |
\fB\-\-sd\fR, \fB\-\-section\-default\fR DEFAULT_SECTION |
| 400 |
Sets the default section for import options: |
| 401 |
('FUTURE', 'STDLIB', 'THIRDPARTY', 'FIRSTPARTY', |
| 402 |
\&'LOCALFOLDER') |
| 403 |
.TP |
| 404 |
\fB\-\-only\-sections\fR, \fB\-\-os\fR |
| 405 |
Causes imports to be sorted based on their sections |
| 406 |
like STDLIB, THIRDPARTY, etc. Within sections, the |
| 407 |
imports are ordered by their import style and the |
| 408 |
imports with the same style maintain their relative |
| 409 |
positions. |
| 410 |
.TP |
| 411 |
\fB\-\-ds\fR, \fB\-\-no\-sections\fR |
| 412 |
Put all imports into the same section bucket |
| 413 |
.TP |
| 414 |
\fB\-\-fas\fR, \fB\-\-force\-alphabetical\-sort\fR |
| 415 |
Force all imports to be sorted as a single section |
| 416 |
.TP |
| 417 |
\fB\-\-fss\fR, \fB\-\-force\-sort\-within\-sections\fR |
| 418 |
Don't sort straight\-style imports (like import sys) |
| 419 |
before from\-style imports (like from itertools import |
| 420 |
groupby). Instead, sort the imports by module, |
| 421 |
independent of import style. |
| 422 |
.TP |
| 423 |
\fB\-\-hcss\fR, \fB\-\-honor\-case\-in\-force\-sorted\-sections\fR |
| 424 |
Honor `\-\-case\-sensitive` when `\-\-force\-sort\-withinsections` is being used. Without this option set, |
| 425 |
`\-\-order\-by\-type` decides module name ordering too. |
| 426 |
.TP |
| 427 |
\fB\-\-srss\fR, \fB\-\-sort\-relative\-in\-force\-sorted\-sections\fR |
| 428 |
When using `\-\-force\-sort\-within\-sections`, sort |
| 429 |
relative imports the same way as they are sorted when |
| 430 |
not using that setting. |
| 431 |
.TP |
| 432 |
\fB\-\-fass\fR, \fB\-\-force\-alphabetical\-sort\-within\-sections\fR |
| 433 |
Force all imports to be sorted alphabetically within a |
| 434 |
section |
| 435 |
.TP |
| 436 |
\fB\-t\fR, \fB\-\-top\fR FORCE_TO_TOP |
| 437 |
Force specific imports to the top of their appropriate |
| 438 |
section. |
| 439 |
.TP |
| 440 |
\fB\-\-combine\-straight\-imports\fR, \fB\-\-csi\fR |
| 441 |
Combines all the bare straight imports of the same |
| 442 |
section in a single line. Won't work with sections |
| 443 |
which have 'as' imports |
| 444 |
.TP |
| 445 |
\fB\-\-nlb\fR, \fB\-\-no\-lines\-before\fR NO_LINES_BEFORE |
| 446 |
Sections which should not be split with previous by |
| 447 |
empty lines |
| 448 |
.TP |
| 449 |
\fB\-\-src\fR, \fB\-\-src\-path\fR SRC_PATHS |
| 450 |
Add an explicitly defined source path (modules within |
| 451 |
src paths have their imports automatically categorized |
| 452 |
as first_party). Glob expansion (`*` and `**`) is |
| 453 |
supported for this option. |
| 454 |
.TP |
| 455 |
\fB\-b\fR, \fB\-\-builtin\fR KNOWN_STANDARD_LIBRARY |
| 456 |
Force isort to recognize a module as part of Python's |
| 457 |
standard library. |
| 458 |
.TP |
| 459 |
\fB\-\-extra\-builtin\fR EXTRA_STANDARD_LIBRARY |
| 460 |
Extra modules to be included in the list of ones in |
| 461 |
Python's standard library. |
| 462 |
.TP |
| 463 |
\fB\-f\fR, \fB\-\-future\fR KNOWN_FUTURE_LIBRARY |
| 464 |
Force isort to recognize a module as part of Python's |
| 465 |
internal future compatibility libraries. WARNING: this |
| 466 |
overrides the behavior of __future__ handling and |
| 467 |
therefore can result in code that can't execute. If |
| 468 |
you're looking to add dependencies such as six, a |
| 469 |
better option is to create another section below |
| 470 |
\fB\-\-future\fR using custom sections. See: |
| 471 |
https://github.com/PyCQA/isort#custom\-sections\-andordering and the discussion here: |
| 472 |
https://github.com/PyCQA/isort/issues/1463. |
| 473 |
.TP |
| 474 |
\fB\-o\fR, \fB\-\-thirdparty\fR KNOWN_THIRD_PARTY |
| 475 |
Force isort to recognize a module as being part of a |
| 476 |
third party library. |
| 477 |
.TP |
| 478 |
\fB\-p\fR, \fB\-\-project\fR KNOWN_FIRST_PARTY |
| 479 |
Force isort to recognize a module as being part of the |
| 480 |
current python project. |
| 481 |
.TP |
| 482 |
\fB\-\-known\-local\-folder\fR KNOWN_LOCAL_FOLDER |
| 483 |
Force isort to recognize a module as being a local |
| 484 |
folder. Generally, this is reserved for relative |
| 485 |
imports (from . import module). |
| 486 |
.TP |
| 487 |
\fB\-\-virtual\-env\fR VIRTUAL_ENV |
| 488 |
Virtual environment to use for determining whether a |
| 489 |
package is third\-party |
| 490 |
.TP |
| 491 |
\fB\-\-conda\-env\fR CONDA_ENV |
| 492 |
Conda environment to use for determining whether a |
| 493 |
package is third\-party |
| 494 |
.TP |
| 495 |
\fB\-\-py\fR, \fB\-\-python\-version\fR {all,2,27,3,310,311,312,313,36,37,38,39,auto} |
| 496 |
Tells isort to set the known standard library based on |
| 497 |
the specified Python version. Default is to assume any |
| 498 |
Python 3 version could be the target, and use a union |
| 499 |
of all stdlib modules across versions. If auto is |
| 500 |
specified, the version of the interpreter used to run |
| 501 |
isort (currently: 313) will be used. |
| 502 |
.TP |
| 503 |
_ |
| 504 |
_ |
| 505 |
.TP |
| 506 |
(_) ___ |
| 507 |
___ _ __| |_ |
| 508 |
.TP |
| 509 |
| |/ _/ / _ \e/ '__ |
| 510 |
_/ |
| 511 |
.TP |
| 512 |
| |\e__ \e/\e_\e/| | |
| 513 |
| |_ |
| 514 |
.TP |
| 515 |
|_|\e___/\e___/\e_/ |
| 516 |
\e_/ |
| 517 |
.IP |
| 518 |
isort your imports, so you don't have to. |
| 519 |
.IP |
| 520 |
VERSION 6.0.0 |
| 521 |
.SH "SEE ALSO" |
| 522 |
Additional documentation for isort is available online at |
| 523 |
.TP |
| 524 |
https://pycqa.github.io/isort/ |