$npx skillfedfor your agent

usort

Safe, minimal import sorting

Worth itPyPI Software DevelopmentReleased Jan 20262.5M downloads / mopermissive licensePure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — usort-1.1.3-py3-none-any.whl
v1.1.3 · released 2026-01-13 · Python >=3.10 · 7 runtime deps: attrs, click, libcst, moreorless, stdlibs, tomli, trailrunner

Yes. μsort is actively maintained, has no known vulnerabilities, installs with low friction, and solves a real problem—safe import sorting that respects code structure. It is a good fit if you want conservative import reordering that avoids breaking changes. The MIT license poses no restrictions.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires Python 3.10 or newer to run
  • Low friction installation with seven runtime dependencies.
  • Active maintenance with latest release on 2026-01-13 and repository last commit on 2026-03-01.

License · maintenance · safety

permissive license (permissive) — MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.

last release 2026-01-13 (213 days) · last repo commit 2026-03-01 · 205 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 2,519,103 downloads/mo, #3,026 on PyPI

Verify before relying

pip install usort
usort format path/to/file.py
# or for validation:
usort check path/to/file.py
  • How μsort handles complex import patterns (star imports, conditional imports, or dynamic imports)
  • Performance characteristics when sorting large files or projects with many imports
  • Compatibility with other formatters and linters beyond pre-commit integration
Same gist for agents: .md · .json

What it is and what it does

μsort is a Python import sorter designed to make minimal, safe changes to code. Rather than reordering all imports globally, it detects distinct blocks of imports separated by non-import statements and sorts only within those blocks. This conservative approach avoids the risk of breaking code where import order matters due to side effects or dependencies between imports.

Within each block, μsort groups imports by source (standard library, third-party, first-party, relative) and sorts lexicographically. It respects skip directives like `#usort:skip` and `#isort:skip` to exclude specific imports from reordering. The tool integrates with pre-commit workflows via a standard hook.

Use it for

  • Enforce consistent import ordering in CI pipelines using `usort check` without modifying code
  • Automatically sort imports in files or directories in-place with `usort format` before committing
  • Generate diffs of import changes with `usort diff` to review before applying
  • Integrate import sorting into pre-commit hooks to maintain order on every commit
  • Sort imports safely in codebases where import order affects behavior due to side effects

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

μsort is actively maintained, has no known vulnerabilities, installs with low friction, and solves a real problem—safe import sorting that respects code structure. It is a good fit if you want conservative import reordering that avoids breaking changes. The MIT license poses no restrictions.

Install

usort on PyPI

Before you install

Low friction installation with seven runtime dependencies. Active maintenance with latest release on 2026-01-13 and repository last commit on 2026-03-01.

Requires Python 3.10 or newer to run

License in practice

MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.

Quickstart

pip install usort
usort format path/to/file.py
# or for validation:
usort check path/to/file.py

Verify before relying

  • How μsort handles complex import patterns (star imports, conditional imports, or dynamic imports)
  • Performance characteristics when sorting large files or projects with many imports
  • Compatibility with other formatters and linters beyond pre-commit integration

Package facts

Licensepermissive license permissive
Python supportSupports the current Python release >=3.10
Install frictionLow. Pure-Python wheel
Runtime dependencies
7 packages
attrsclicklibcstmoreorlessstdlibstomlitrailrunner
MaintenanceActively maintained 213 days since the last release
Last repo commit
First released
Downloads2,519,103 / month, #3,026 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseTopic :: Software DevelopmentTopic :: UtilitiesTyping :: Typed

Evidence: usort-1.1.3-py3-none-any.whl

Tags

Capabilities
python import sortingsafe import reorderingimport block detectionminimal import formatterimport organization toolpython code formatterimport grouping
Topics
import-sortingcode-formatterpre-commit-hook
PyPI keywords
importsisortusort

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “safe import reordering”

  • usortμsort sorts Python imports within detected blocks while preserving…
  • reorder-python-importsAutomatically reorders Python imports into a standardized format…
  • extrasProvides three utility functions—try_import, try_imports, and…

Give your agent the search over MCP, or paste the wish link into any chat.

More Software Development packages

typing-extensions Worth it
PyPI · Software Development · released Jul 2026

Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.

PSF-2.0pure Python · 3.9+
1.9Bdownloads / mo
numpy Worth it
PyPI · Software Development · released Aug 2026

NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0compiled wheel · 3.12+
1.1Bdownloads / mo
fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.

MITpure Python · 3.9+
456.2Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.

Install it if you are building CLIs in Python.

MITpure Python · 3.10+
369.3Mdownloads / mo
distlib With conditions
PyPI · Software Development · released Jun 2026

Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.

permissive licensepure Python
323.3Mdownloads / mo

See also ufmt · reorder-python-imports · classify-imports · isort · pytest-isort · natsort · aspy.refactor-imports · sort-lines · csvsort · stdlibs