Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyfixfmt-0.9.2.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

pyfixfmt-0.9.2-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

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

Hashes for pyfixfmt-0.9.2.tar.gz
Algorithm Hash digest
SHA256 9354fdf890982e568d41c89e3b917e11f9a4635ef3504fda1eb88595beb9425d
MD5 22f35fa7755f192c525fb9002bb3a689
BLAKE2b-256 b6d00e9ae70518975c88b0520793e74f06d6e7d0b791f50acdb8ef900703dff9

See more details on using hashes here.

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

Hashes for pyfixfmt-0.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b6b944b1a2b01ba0c1a5aa2ad502b190ae934cfe08d0af84c6e364426f480605
MD5 41507c4bf4c33ffd78fb48e46672b70c
BLAKE2b-256 baf48916a5a4185b276dc8f3d445d171fdb818f9cfc88e3d0e5da9f9ec2790b0

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