Generated by GPT-5-mini| isort | |
|---|---|
| Name | isort |
| Programming language | Python |
| Operating system | Cross-platform |
| License | MIT License |
isort
isort is a Python tool that automatically sorts and formats import statements in source files to a consistent, configurable order. It is used in software projects, continuous integration, and developer workflows alongside tools such as GitHub, GitLab, Travis CI, Circle CI, and Jenkins to enforce import ordering standards. Influencing readability and maintenance across codebases maintained by organizations like Google, Microsoft, Facebook, Dropbox, and Mozilla, it complements linters and formatters such as Flake8, PyLint, Black (software), autopep8, and Prettier.
isort originated to address inconsistencies in import ordering that can complicate diffs and code reviews in collaborative projects hosted on platforms like SourceForge, Bitbucket, and GitHub. Early Python style efforts were informed by publications such as PEP 8 and projects like Python (programming language), with companies and institutions including NASA, European Space Agency, Intel, and ARM Holdings adopting style guides that facilitated tools like isort. Over time the project evolved through contributions from developers affiliated with communities such as the Python Software Foundation, Django Software Foundation, and open source ecosystems around Flask (web framework), Pyramid (web framework), and Ansible. Development milestones often coincided with major releases of Python (programming language), changes in packaging standards promoted by PyPI, and integrations with emerging CI systems such as Travis CI and GitHub Actions.
isort provides deterministic sorting algorithms, grouping, and formatting options to match a wide variety of coding standards used by projects at institutions like Harvard University, MIT, Stanford University, Carnegie Mellon University, and University of Cambridge. Key capabilities include automatic grouping of standard library imports, third-party libraries (for example NumPy, Pandas, Requests (software), Django (web framework), Flask (web framework)), and local application imports; support for multi-line wrapping styles influenced by standards such as PEP 8 and tools like Black (software); and handling of complex import forms used in projects such as TensorFlow, PyTorch, SciPy, and scikit-learn. It supports customizable sections, import comments preservation (as used by maintainers of CPython), and compatibility with packaging metadata conventions from setuptools, pip, and Poetry (software). isort can perform safe reordering to avoid altering runtime behavior in environments influenced by platform specifics from Windows, macOS, and Linux distributions like Debian, Ubuntu, and Fedora.
Typical usage patterns integrate isort into developer workflows alongside version control operations on platforms such as Git and Mercurial (software), and code hosting services like GitHub and GitLab. Developers invoke isort via a command line interface, through pre-commit hooks supported by the pre-commit framework used by many repositories including those at Mozilla and OpenStack, or programmatically from tools within projects such as Sphinx (software), pytest, and tox. In CI pipelines powered by Jenkins, Travis CI, Circle CI, and GitHub Actions, isort can run as a verification step similar to static analysis tools from SonarQube, Coverity, and Bandit (software). Common workflows include running isort before committing changes with integrations into editors used by developers at companies like JetBrains (products including PyCharm), Microsoft (including Visual Studio Code), and organizations adopting Eclipse-based tooling.
Configuration is flexible and stored in common configuration files used across projects, such as setup.cfg, pyproject.toml, tox.ini, and .editorconfig, enabling consistency with project metadata standards advocated by organizations like Python Packaging Authority and package indexes like PyPI. Options allow teams influenced by style guides from institutions including Google and WordPress to define import sections, known third-party module lists, forced grouping, line length, and wrap modes compatible with formatting choices from Black (software) or autopep8. Advanced configuration supports per-directory overrides common in monorepos managed by companies like Facebook and Google and interoperation with dependency management tools such as pipenv and Poetry (software). isort also exposes an API for programmatic configuration used in larger systems like documentation generators from Read the Docs and continuous delivery pipelines.
isort integrates with a broad ecosystem of editors and IDEs used by professional developers at enterprises including Amazon (company), Microsoft, IBM, and Intel. Official and community-maintained plugins exist for Visual Studio Code, PyCharm, Sublime Text, Vim, Neovim, Emacs, and Atom (text editor). Integration patterns mirror those of linters and formatters such as Flake8, Black (software), and Prettier, enabling on-save formatting, project-wide batch operations, and real-time diagnostics similar to language servers like Microsoft Language Server Protocol. In corporate environments managed with configuration management tools such as Ansible, Chef, and Puppet, isort is commonly enforced via shared configuration templates and CI rules.
isort development is driven by contributors from open source communities including the Python Software Foundation, academic institutions like MIT and Stanford University, and corporations such as Google, Microsoft, and GitHub. The project receives contributions through platforms like GitHub and collaborates with adjacent projects in the Python ecosystem including Black (software), Flake8, pre-commit, and pytest. Governance follows typical open source models with issue tracking, pull requests, and release management aligning with practices used by projects such as Django (web framework), NumPy, and Pandas. Community support is provided via discussion channels used by Python projects, including forums, chat networks like Matrix (protocol), and mailing lists historically used by CPython contributors. Continuous integration and quality checks for isort are performed using services such as GitHub Actions, Travis CI, and Circle CI.
Category:Python (programming language) software