Skip to main content

Usage

simp.py [-h] [--commit] [--dry_run] [--fail] [targets [targets ...]]

Description

Sort the import directives in Python files, excluding __future__.

Positional arguments

targets

One or more Python files or directories with Python files. Without arguments, runs simp on the current directory.

Optional arguments

-h, --help

Show this help message and exit

--commit, -c

Git commit the changes

--dry_run, -d

If set, do not make the changes to the Python files, but just list the diffs.

--fail, -f

If set, the program fails if any changes need to be made. This is useful for a commit hook to check if all imports are sorted.

Comments

I wanted to sort my Python includes with no fuss. simp finds the first block of unindented import statements, and sorts them. Any comments between import lines bubble up to the top in their original order.

(automatically generated by doks on 2020-11-01T14:22:18.849238)

Release files for simp 2.0.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 simp 2.0.0
File Size Uploaded
simp-2.0.0.tar.gz 6.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for simp 2.0.0
File Interpreter ABI Platform
simp-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 13.9 kB

Release files / simp-2.0.0.tar.gz

Download URL simp-2.0.0.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d16d121094ee3bf7b23a37fc2c84e3831b76e2ab9a6f5a583e1e41fca0bd2989
BLAKE2b-256 checksum
How to use checksums
388d36734b83e5012053749c545229dabe1fbe9a10e75a3483d5ab8337825718
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.6.6

Release files / simp-2.0.0-py3-none-any.whl

Download URL simp-2.0.0-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e80c4e28ef3f0d0fc4022aba0e0c68776ca01f51aea08478c0f9e2c3e337f9e8
BLAKE2b-256 checksum
How to use checksums
9d8312e1803b83a2b79dd0928d1d02ab0747ba039b1a00f3482c647610c3ee33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.6.6

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

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