https://github.com/alyetama/fmp
Formats python files with properly sorted import statemnts
https://github.com/alyetama/fmp
formatter pep8 python yapf
Last synced: 3 months ago
JSON representation
Formats python files with properly sorted import statemnts
- Host: GitHub
- URL: https://github.com/alyetama/fmp
- Owner: Alyetama
- License: mit
- Created: 2022-04-11T06:31:42.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-06T22:32:12.000Z (about 3 years ago)
- Last Synced: 2025-05-22T10:56:41.531Z (5 months ago)
- Topics: formatter, pep8, python, yapf
- Language: Python
- Homepage: https://alyetama.github.io/fmp
- Size: 874 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fmp: (F)or(m)at(P)ython
A Python formatter that uses [yapf](https://github.com/google/yapf) and [autoflake](https://github.com/PyCQA/autoflake) to format python files, but ***with properly sorted import statements***.
[](https://github.com/Alyetama/fmp/actions/workflows/poetry-build.yml) [](https://badge.fury.io/py/fmp) [](https://www.python.org/downloads/) [](https://www.python.org/dev/peps/pep-0008/) [](https://github.com/Alyetama/Discord-Backup-Bot/blob/main/LICENSE)
## 🐍 Requirements
- [Python>=3.6](https://www.python.org/downloads/)
## ⬇️ 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 formatoptions:
-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
[](https://asciinema.org/a/x8UJrOu8PY7kvMV4UaYbHmrO9)