Skip to main content

No fretting about pretty Python

Project description

frettipy

No fretting about pretty Python.

  • Prefer single over double quotation mark
  • Do not omit zero before or after decimal point
  • Spaces around binary operator
  • No space after unary operator
  • Spaces around comparison operator
  • No spaces around argument-assignment operator
  • No space on inner side of bracket
  • No explicit line joining in brackets
  • Slices: no spaces around slice operator
  • Dictionaries: space after colon (but not before)
  • Same indentation of lines with opening and closing bracket
  • Spaces around assignment operator
  • Block initiation: no space before colon
  • Space after comma (but not before)
  • No double spaces
  • Single space between non-whitespace character and comment
  • No space before opening bracket (except after keyword)
  • Indentation with four spaces instead of tabs
  • No trailing whitespace
  • No double blank lines (except before class or function)
  • No blank line at end of file
  • No blank line at beginning of file
  • Newline character at end of last line

Synopsis

This script formats Python source code following the above style conventions.

frettipy [-f] FILE

If -f is present, FILE is modified in place! Keep a copy or use version control. Otherwise the intended modifications are shown without changing FILE.

If FILE is a directory, all .py and .Rmd files in the tree are processed!

Installation

Either from PyPI:

python3 -m pip install frettipy

Or from GitHub:

python3 -m pip install git+https://github.com/janberges/frettipy

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

frettipy-0.7.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

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

frettipy-0.7-py2.py3-none-any.whl (5.9 kB view details)

Uploaded Python 2Python 3

File details

Details for the file frettipy-0.7.tar.gz.

File metadata

  • Download URL: frettipy-0.7.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for frettipy-0.7.tar.gz
Algorithm Hash digest
SHA256 08f4063f210d3974319aa17a5f736e2cf3af6bed49f56761dbc7d6344a3c2069
MD5 3348ab50e406b329602c0215092b4dce
BLAKE2b-256 756a26377cf7d83ba6b6cbca713c5ae1a9b027452acbd568e976bd420b3b6ec0

See more details on using hashes here.

File details

Details for the file frettipy-0.7-py2.py3-none-any.whl.

File metadata

  • Download URL: frettipy-0.7-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for frettipy-0.7-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 53ff282ca4824d63b46bfd41d88731582ffdd1963d92dfbccc8c5d9e838870b8
MD5 fc1fc571e9a13907191b835a9eebefa4
BLAKE2b-256 4aeb1351e402b43dcc797611f9bef18de9d67b841ebc0ec5adb2dc55e6b8ec37

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