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.8.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.8-py2.py3-none-any.whl (5.9 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

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

File hashes

Hashes for frettipy-0.8.tar.gz
Algorithm Hash digest
SHA256 64aae5533792101c4afabb066e3befe39300468fbea9f1ead04fe49a11c20ab6
MD5 f95a1f5e2819a2b1bc8b53a3594b5a35
BLAKE2b-256 08f5bf996ffb05b2d0c20849f8119f59b5d04669cb2957757ccf317903c6595b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: frettipy-0.8-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.2.0 CPython/3.11.2

File hashes

Hashes for frettipy-0.8-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a1336eca523b35e6d008acda81d7be7b4d3b91ebe0a5c9690ce8f66cda1b3efe
MD5 b6881b1b7cff4f5bcb7a40c0ca3057a6
BLAKE2b-256 7a625da6c1c9bbf55018e67a114de95ce5b992e9b1998372dddecc5ec16535ec

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