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.

Source Distribution

simp-1.0.2.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

simp-1.0.2-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file simp-1.0.2.tar.gz.

File metadata

  • Download URL: simp-1.0.2.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for simp-1.0.2.tar.gz
Algorithm Hash digest
SHA256 3d12b6fbf8e04f3085ec2c96fa5dc8679e70b2582915fe6794518602da296d13
MD5 f1206e25c399320063c3050cfe760b2b
BLAKE2b-256 56530aa19665567504ac34d322cb7493a533f5dd989bde8150f3bb0e926bc9b7

See more details on using hashes here.

File details

Details for the file simp-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: simp-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for simp-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 31492a2f376ea6fe6df484593e39a5434038e4ee5e5871a7f49238618cf7f847
MD5 161b60b4e62f92b449e01987cbd0bcf0
BLAKE2b-256 8ab7c7a1fbd19e7e8060d381a9a9e4c9140bb5fefc39897c2b65062c28aeaed2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page