Skip to main content

A Python source formatter that uses the tokenize library to ensure correctness

Project description

Introduction

Test Status Coverage Status

formatter2 is a Python formatter based on the tokenize library in Python. Due to a bug with line continuations we are currently running a fork of the tokenize library however.

During every format sequence the compile method is used to check if no code has been broken, but backing up is still a good idea.

The library is made to be very extendable and configurable but it’s still in the beginning phase. Eventually this will become a fully featured formatting tool for Python.

Install

To install simply execute python setup.py install or pip install formatter2. If you want to run the tests first, run nosetests

Usage

To format all of your code recursively (MAKE BACKUPS!):

python-formatter -r DIRECTORY

Or:

format-python -r DIRECTORY

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

formatter2-1.3.0.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

formatter2-1.3.0-py2.py3-none-any.whl (25.7 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file formatter2-1.3.0.tar.gz.

File metadata

  • Download URL: formatter2-1.3.0.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for formatter2-1.3.0.tar.gz
Algorithm Hash digest
SHA256 69f8c2bdcd883514b47321349178f14fe5c53567b75f464c93692320e98e6467
MD5 11c342e3b1e5d9d56d636688e8ed68a0
BLAKE2b-256 a00756f4b619d1b6a057eaff0ba6cb4cb1bbc6a3d02b3d3dacb666ed955ecaea

See more details on using hashes here.

File details

Details for the file formatter2-1.3.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for formatter2-1.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5884d478f760b23b58d103d963b19e09b52d1bf516654783860af2627d14e59b
MD5 7f19a2562d853fb3f2f2cc664b1bc8f9
BLAKE2b-256 6a31d4da800233f4574ec9128740c29938053b4f92c85f01878411efd31da108

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