Skip to main content

sorti

An opinionated CLI for asottile/reorder_python_imports.

Installation

pip install sorti

Usage

sorti [-h] [--check] [--version] [source [source ...]]

Examples

Sorting imports in a single file

sorti my/file.py

Checking if any files in a directory need sorting

sorti --check my/directory

Why?

This package makes the features of reorder_python_imports fit into my workflow. I think the original project is awesome, but the CLI does not work the way I would like it to.

My opinions diverge from asottile's on these issues.

So, sorti will support a much narrower use case than the original project. The command has one flag: --check, which will make the command output the files it would change and return an exit code of 1 if there are changes to be made.

sorti uses source file discovery from python/black and aims to find the same files, given the same inputs.

I don't intend to support anything else than latest stable Python, for the moment that is 3.7.

The name sorti which means exit in Swedish seemed fitting since the divergence of opinions that lead to its creation was about exit codes, it's also a play on the popular import sorter isort. In Old Norse it means black cloud, which also seems appropriate since it uses parts of black.

Metadata

Release files for sorti 2.0.1

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

Source distribution (sdist)

Source distribution for sorti 2.0.1
File Size Uploaded
sorti-2.0.1.tar.gz 3.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for sorti 2.0.1
File Interpreter ABI Platform
sorti-2.0.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 8.0 kB

Release files / sorti-2.0.1.tar.gz

Download URL sorti-2.0.1.tar.gz
Size 3.9 kB
Tags Source
SHA-256 checksum
How to use checksums
78096f944799a4db76d4ca3d883a4ec9c319f40c9a0a523c0c2d975bbb7a0aea
BLAKE2b-256 checksum
How to use checksums
6d89863fc2d5d50ada816ffbe781ccf4a8d9d840ab235961c007049dc7746ceb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.8.0

Release files / sorti-2.0.1-py2.py3-none-any.whl

Download URL sorti-2.0.1-py2.py3-none-any.whl
Size 4.1 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
55ccd0ab353628f52baf7fe74f6d6fba5ce0a413c548acdb4a3df48334737dbe
BLAKE2b-256 checksum
How to use checksums
5aecce7f73c43bb7ab24cd9763c75507399f3a1d9c50d3af872fa593eecd6b84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.8.0

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 release files

2.0.0

2 release files

1.0.0

2 release files

0.0.1

2 release files

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