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)
  • 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 files in the directory 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.5.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

frettipy-0.5-py2.py3-none-any.whl (5.5 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

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

File hashes

Hashes for frettipy-0.5.tar.gz
Algorithm Hash digest
SHA256 22816969ddb95125ee09c03b3c451e0276d428855e865637c0bac35ab3bd27d2
MD5 47b37279a20658deb00f34ced9352405
BLAKE2b-256 5a209d46689645f7b700a7ad63c28f33a3fc8f51c6d788fae93988402a596ce8

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for frettipy-0.5-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 2a9c21b7e98f8013c4eaf13e9f3b290fb3eded656dd16d3ad1df65937440f198
MD5 bc53400153ceab106b1e91f316494662
BLAKE2b-256 70cf030118eef8c789a666080fbe2fa25f1d00eb6f51878d6b73bd303567ee33

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