Skip to main content
https://github.com/gforcada/flake8-isort/actions/workflows/tests.yml/badge.svg?branch=main https://coveralls.io/repos/gforcada/flake8-isort/badge.svg?branch=main

Flake8 meet isort

Use isort to check if the imports on your python files are sorted the way you expect.

Add an .isort.cfg to define how you want your imports sorted and run flake8 as you usually do.

See isort documentation for .isort.cfg available options.

Install

Install with pip:

$ pip install flake8-isort

Install with conda:

$ conda install -c conda-forge flake8-isort

Configuration

If using the select option from flake8 be sure to enable the I category as well, see below for the specific error codes reported by flake8-isort.

See flake8 --help for available flake8-isort options.

Error codes

Error code

Description

I001

isort found an import in the wrong position

I002

no configuration found (.isort.cfg or [isort] in configs)

I003

isort expected 1 blank line in imports, found 0

I004

isort found an unexpected blank line in imports

I005

isort found an unexpected missing import

Requirements

  • Python 3.9, 3.10, 3.11, 3.12, 3.13 and pypy3

  • flake8

  • isort

Relation to flake8-import-order

As an alternative to this flake8 plugin, there’s flake8-import-order that could be worth checking out. In contrast to this plugin that defers all logic to isort, the flake8-import-order comes bundled with it’s own logic.

flake8-import-order comes with a few predefined set of styles meanwhile this plugin can be customized a bit more. But the biggest difference could lie in that flake8-isort actually has the corresponding sorting engine isort that can sort the import orders of your existing python files. Meanwhile flake8-import-order has no such corresponding tool, hence big existing projects who want to adopt either would get a more automized experience choosing flake8-isort.

License

GPL 2.0

Release files for flake8-isort 7.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flake8-isort 7.0.0
File Size Uploaded
flake8_isort-7.0.0.tar.gz 17.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for flake8-isort 7.0.0
File Interpreter ABI Platform
flake8_isort-7.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 36.2 kB

Release files / flake8_isort-7.0.0.tar.gz

Download URL flake8_isort-7.0.0.tar.gz
Size 17.8 kB
Tags Source
SHA-256 checksum
How to use checksums
a677199d1197f826eb69084e7ac272f208f4583363285f43111c34272abe7e5d
BLAKE2b-256 checksum
How to use checksums
57a44b170983fd2e9b5ecc40c88738db6dfb77e069c71be9a81f9893cdb8a0cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / flake8_isort-7.0.0-py3-none-any.whl

Download URL flake8_isort-7.0.0-py3-none-any.whl
Size 18.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c301a0e55fc77582348e636194b84b1a0baf0dfdaa6eddf3b0eeea75f8be7f36
BLAKE2b-256 checksum
How to use checksums
177d907ef4135f6ede5187930d9ddd1f36564e07c6cdcd15ae8fb9849c9517e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

7.0.0 This release

2 release files

6.1.2

2 release files

6.1.1

2 release files

6.1.0

1 release file

6.0.0

2 release files

5.0.3

2 release files

5.0.2

2 release files

5.0.1

2 release files

5.0.0

2 release files

4.2.0

2 release files

4.1.2

1 release file

4.1.1

2 release files

4.1.0

2 release files

4.0.0

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.9.1

2 release files

2.9.0

2 release files

2.8.0

2 release files

2.7.0

2 release files

2.6.0

2 release files

2.5

2 release files

2.4

2 release files

2.3

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2

2 release files

2.1.3

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0

2 release files

1.3

2 release files

1.2

2 release files

1.1.1

2 release files

1.1

2 release files

1.0

2 release files

0.2

2 release files

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page