Skip to the content.

fmp: (F)or(m)at(P)ython

A Python formatter that uses yapf and autoflake to format python files, but with properly sorted import statements.

Build PyPI version Supported Python versions PEP8 GitHub License

🐍 Requirements

⬇️ Installation

pip install fmp

⌨️ Usage

usage: fmp [-h] [-s {pep8,google,yapf,facebook}] [-i] [-o] [-n] [-k] [-K]
           files [files ...]

positional arguments:
  files                 Files to format

options:
  -h, --help            show this help message and exit
  -s {pep8,google,yapf,facebook}, --style {pep8,google,yapf,facebook}
                        Formatting style
  -i, --in-place        Make changes in-place
  -o, --only-imports    Only return sorted import statements
  -n, --show-line-numbers
                        Render a column for line numbers
  -k, --keep-unused-imports
                        Keep the import statement of all unused modules
  -K, --keep-external-unused-imports
                        Keep the import statement of external unused modules

📕 Examples

Examples