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.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: simp-1.0.0.tar.gz
  • Upload date:
  • Size: 5.9 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.0.tar.gz
Algorithm Hash digest
SHA256 1e424d3699a34afad0a2778f7c1e032c627c0bca62aaf8fa25075d0562300437
MD5 8721a9ece006e6897739c45c15d4855b
BLAKE2b-256 f843af57327ffa078394c569614efae0e66a98b90a202649c9554ed555673c5c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: simp-1.0.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6c8cc7a9f18d3a8017b9d1dcf2cf63205e14371c3ac58a052b632fc174677b42
MD5 76b35b2dec17ce013f4851aa20747a79
BLAKE2b-256 513d7935fa7b10b29a389c7438d42169ab0d976ed2dc434a931bd774a37373d2

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