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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyfixfmt-0.9.1-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file pyfixfmt-0.9.1.tar.gz.

File metadata

  • Download URL: pyfixfmt-0.9.1.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.9.2 Darwin/20.3.0

File hashes

Hashes for pyfixfmt-0.9.1.tar.gz
Algorithm Hash digest
SHA256 f9562e6f2069dd57db197143b6b19578ebc53adcace61ce37f91e265101c5fae
MD5 4a85d45c1834debbfe9ac80b1de6a3dd
BLAKE2b-256 97d87f2f72a380179d1c181e0dddfca8b4fc2ab74546e08d876fb97b35963930

See more details on using hashes here.

File details

Details for the file pyfixfmt-0.9.1-py3-none-any.whl.

File metadata

  • Download URL: pyfixfmt-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.9.2 Darwin/20.3.0

File hashes

Hashes for pyfixfmt-0.9.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0ef3d641d01d87390cce982f4eb87f25f1f402f3bc9048050f000d0db58dd0c3
MD5 df86e47fd214c9bbd5170164ab5ab3c2
BLAKE2b-256 a6e403387c66a9742c1aaeea0899d25ba916b723713c4f6b7b9f80f62b0ea690

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page