Skip to main content

Sort imports simply

Project description

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for simp, version 1.0.2
Filename, size File type Python version Upload date Hashes
Filename, size simp-1.0.2.tar.gz (6.0 kB) File type Source Python version None Upload date Hashes View
Filename, size simp-1.0.2-py3-none-any.whl (7.6 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page