Skip to main content

Flake8 meet isort

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

Add an .isort.cfg configuration file 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.1+ 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.

License

GPL 2.0

Metadata

Release files for flake8-isort 7.1.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.1.0
File Size Uploaded Provenance Actions
flake8_isort-7.1.0.tar.gz 17.7 kB Without provenance Details for flake8_isort-7.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 35.9 kB

Release files / flake8_isort-7.1.0.tar.gz

Download URL flake8_isort-7.1.0.tar.gz
Size 17.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ee28333c6deb834908cda1899c3da7d59ab0429482bb200fb7b3cc4182d2bcab
BLAKE2b-256 checksum
How to use checksums
807282d10b7c9d42d4a8df8917d7f5fd6b604184749ab34ab727237f06e9951b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

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

Download URL flake8_isort-7.1.0-py3-none-any.whl
Size 18.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7450f0450fed9e5e805108f129cbc244b4a17c4c0dc04cb331f45397173a9e04
BLAKE2b-256 checksum
How to use checksums
8104e63868bd8bcc179665c4a5a1a26717373a1bce37aefb8d49da1c2670e3fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.8

Security for flake8-isort 7.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

7.1.0 This release

2 release files No provenance

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