Run several python fixers over a python file, to provide simple, deterministic code formatting.
Project description
PyFixFmt
Your all-in-one python formatter. Able to be called on files or strings to format and standarize a Python file.
Removes unused imports (with autoflake), sorts imports (with isort), and then formats the code (with black). It will respect your project's pyproject.toml
configuration for those tools.
Meant to make formatting of python code as deterministic as sanely possible.
Instructions
To install:
pip install pyfixfmt
To run:
# file-glob can be either a single file name or a normal unix glob.
python -m pyfixfmt --file-glob <your file glob here> --verbose
Configuration:
# in pyproject.toml
[tool.formatters.python]
# Do not change anything about imports in these files
ignore_import_changes = []
# Do not remove imports that are unused in these files
do_not_remove_imports = []
Developing
Develop with Poetry.
Build with poetry build
, and publish with poetry publish
.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pyfixfmt-0.9.2.tar.gz
.
File metadata
- Download URL: pyfixfmt-0.9.2.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.9.2 Darwin/21.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9354fdf890982e568d41c89e3b917e11f9a4635ef3504fda1eb88595beb9425d |
|
MD5 | 22f35fa7755f192c525fb9002bb3a689 |
|
BLAKE2b-256 | b6d00e9ae70518975c88b0520793e74f06d6e7d0b791f50acdb8ef900703dff9 |
File details
Details for the file pyfixfmt-0.9.2-py3-none-any.whl
.
File metadata
- Download URL: pyfixfmt-0.9.2-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.9.2 Darwin/21.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6b944b1a2b01ba0c1a5aa2ad502b190ae934cfe08d0af84c6e364426f480605 |
|
MD5 | 41507c4bf4c33ffd78fb48e46672b70c |
|
BLAKE2b-256 | baf48916a5a4185b276dc8f3d445d171fdb818f9cfc88e3d0e5da9f9ec2790b0 |