isort VS black

Compare isort vs black and see what are their differences.

Our great sponsors
  • Scout APM - A developer's best friend. Try free for 14-days
  • Nanos - Run Linux Software Faster and Safer than Linux with Unikernels
  • SaaSHub - Software Alternatives and Reviews
isort black
9 106
4,323 23,696
3.3% 5.1%
9.4 9.4
4 days ago 4 days ago
Python Python
MIT License MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

isort

Posts with mentions or reviews of isort. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-11-07.
  • Python Code Quality - Improve the quality of your Python code with linters, code formatters, and security vulnerability scanners
    7 projects | reddit.com/r/Python | 7 Nov 2021
    yaml repos: - repo: https://github.com/myint/autoflake rev: v1.4 hooks: - id: autoflake args: - --in-place - --remove-all-unused-imports - --expand-star-imports - --remove-duplicate-keys - --remove-unused-variables - repo: https://github.com/asottile/pyupgrade rev: v2.29.0 hooks: - id: pyupgrade args: [--py36-plus] - repo: https://github.com/PyCQA/isort rev: 5.9.3 hooks: - id: isort - repo: https://github.com/psf/black rev: 21.10b0 hooks: - id: black args: [--safe, --quiet] - repo: https://github.com/PyCQA/flake8 rev: 4.0.1 hooks: - id: flake8 - repo: local hooks: - id: pylint name: pylint entry: pylint language: system types: [python] args: [ "-rn", "-sn", ] - repo: https://github.com/pre-commit/mirrors-mypy rev: v0.910-1 hooks: - id: mypy name: mypy entry: mypy language: python types: [python] args: [] require_serial: true - repo: https://github.com/pre-commit/mirrors-prettier rev: v2.4.1 hooks: - id: prettier args: [--prose-wrap=always, --print-width=88]
  • Code Quality Tools in Python
    9 projects | dev.to | 9 Oct 2021
    Formatters automatically format your code based on a style guide. Some popular formatters are Black, YAPF, autopep8 and isort.
  • Three cool projects to contribute to during Hacktoberfest
    14 projects | dev.to | 7 Oct 2021
  • Automate Clean Code and Linting in Python
    6 projects | dev.to | 22 Aug 2021
    isort 4.1k+ ⭐️
  • Write better Python - with some help!
    8 projects | dev.to | 3 Aug 2021
    If you like to keep your imports in tact, there are also rules to enforce a specific order amongst them. One tool that does that is isort. Isort follows the order:
  • Make your Django project newbie contributor friendly with pre-commit
    5 projects | dev.to | 4 Jul 2021
    $ pre-commit install pre-commit installed at .git/hooks/pre-commit $ git add .pre-commit-config.yaml $ git commit -m "Add pre-commit config" [INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks. [INFO] Initializing environment for https://gitlab.com/pycqa/flake8. [INFO] Initializing environment for https://github.com/pycqa/isort. [INFO] Initializing environment for https://github.com/python/black. [INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for https://gitlab.com/pycqa/flake8. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for https://github.com/pycqa/isort. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... [INFO] Installing environment for https://github.com/python/black. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... Trim Trailing Whitespace.................................................Passed Check Yaml...............................................................Passed Check for merge conflicts................................................Passed Debug Statements (Python)............................(no files to check)Skipped Check for added large files..............................................Passed Fix requirements.txt.................................(no files to check)Skipped Check django project for potential problems..........(no files to check)Skipped Check django project for missing migrations..........(no files to check)Skipped flake8...............................................(no files to check)Skipped isort................................................(no files to check)Skipped black................................................(no files to check)Skipped
  • How to Protect Your Python Code Health 🐍🩺
    2 projects | dev.to | 6 Jun 2021
    A formatter arranges our code so that it's more readable on the screen, but does not change what our code does. Black and isort are formatters.
  • Looking Beyond Nox
    7 projects | dev.to | 8 Apr 2021
    Run syntax checks, including isort through flake8, and generate a report for each sub-project.
  • Python: Setting Up Project Environment
    12 projects | dev.to | 13 Oct 2020
    isort is also a similar tool to flake8, this tool sorts imports alphabetically, and automatically separated into sections and by type.

black

Posts with mentions or reviews of black. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2021-11-15.
  • My first Django project
    2 projects | reddit.com/r/django | 15 Nov 2021
    Your code style is pretty inconsistent. Consistency makes code nicer to read, so I would recommend you look into linters (flake8, or pylint), and also code formatters (black). Never worry about forgetting to put a blank line at the end of the file, or leaving 5. (Also, it makes your git commits cleaner, because it automatically adds things like dangling commas, so if you add something to a list, it doesn't change the previous line).
  • Support Python 3.10 pattern matching syntax · Issue #2242 · psf/black
    1 project | news.ycombinator.com | 13 Nov 2021
  • Music Synthesis with python
    6 projects | reddit.com/r/Python | 10 Nov 2021
    GitHub Repo
  • Python Code Quality - Improve the quality of your Python code with linters, code formatters, and security vulnerability scanners
    7 projects | reddit.com/r/Python | 7 Nov 2021
    yaml repos: - repo: https://github.com/myint/autoflake rev: v1.4 hooks: - id: autoflake args: - --in-place - --remove-all-unused-imports - --expand-star-imports - --remove-duplicate-keys - --remove-unused-variables - repo: https://github.com/asottile/pyupgrade rev: v2.29.0 hooks: - id: pyupgrade args: [--py36-plus] - repo: https://github.com/PyCQA/isort rev: 5.9.3 hooks: - id: isort - repo: https://github.com/psf/black rev: 21.10b0 hooks: - id: black args: [--safe, --quiet] - repo: https://github.com/PyCQA/flake8 rev: 4.0.1 hooks: - id: flake8 - repo: local hooks: - id: pylint name: pylint entry: pylint language: system types: [python] args: [ "-rn", "-sn", ] - repo: https://github.com/pre-commit/mirrors-mypy rev: v0.910-1 hooks: - id: mypy name: mypy entry: mypy language: python types: [python] args: [] require_serial: true - repo: https://github.com/pre-commit/mirrors-prettier rev: v2.4.1 hooks: - id: prettier args: [--prose-wrap=always, --print-width=88]
  • Help with int
    1 project | reddit.com/r/learnpython | 6 Nov 2021
  • 2 Static Analysis Tools to Enhance Your Productivity
    5 projects | dev.to | 5 Nov 2021
    repos: - repo: https://github.com/psf/black rev: 21.10b0 hooks: - id: black - repo: https://github.com/pycqa/flake8 rev: 4.0.1 hooks: - id: flake8
  • DPS909 - Lab 7
    2 projects | dev.to | 5 Nov 2021
    For feature 1, we had to implement a formatter for our project. Since my static site generator is developed in Python, I opted to use the black formatter. It has the best features, and is one of the most popular formatters for Python. You can see the changes that the formatter did, as well as my simple bash script that the user can run to format the files at the same time. Commit
  • I really don't like python. How can I learn to enjoy it?
    2 projects | reddit.com/r/Python | 5 Nov 2021
    There are ways you can work to get more comfortable with the style--Advent of Code is upcoming and has a bunch of puzzles which act as small ways to get familiar with a language. Additionally there's the Black Formatter which enforces a strict format for your code which can help with the loosey goosey side of it. But at the end of the day if you give it a honest shot and the language doesn't work for you--then it doesn't work for you. And there's nothing wrong with that at all.
  • Guide to Reformatting Code in IntelliJ
    1 project | reddit.com/r/coding | 3 Nov 2021
    We started to use Black as code formatting tool for our Python code in IntelliJ. And for myself, I made convenient shortcut (SHIFT+ALT+F since it is the same as in VS Code). Black calls itself "The uncompromising code formatter", so no more bikeshedding in our team about quote style, tabs or spaces, how to break up calls that uses fluent interface patterns etc.
  • structuring larger projects, and good practises
    2 projects | reddit.com/r/learnpython | 21 Oct 2021

What are some alternatives?

When comparing isort and black you can also consider the following projects:

yapf - A formatter for Python files

autopep8 - A tool that automatically formats Python code to conform to the PEP 8 style guide.

prettier - Prettier is an opinionated code formatter.

awesome-python-typing - Collection of awesome Python types, stubs, plugins, and tools to work with them.

Pylint - It's not just a linter that annoys you!

autoflake - Removes unused imports and unused variables as reported by pyflakes

mypy - Optional static typing for Python

pyright - Static type checker for Python

Poetry - Python dependency management and packaging made easy.