f2format - Backport Compiler for Formatted String Literals

Write formatted string literals in Python 3.6 flavour, and let f2format worry about back-port issues 🍺

Since PEP 498, Python introduced formatted string literals syntax in version 3.6. For those who wish to use formatted string literals in their code, f2format provides an intelligent, yet imperfect, solution of a backport compiler by replacing formatted string literals syntax with old-fashioned syntax, which guarantees you to always write formatted string literals in Python 3.6 flavour then compile for compatibility later.

Installation

Warning

f2format is currently under reconstruction. It is highly recommended to directly install from the git repo or the pre-release distributions.

Note

f2format only supports Python versions since 3.4 🐍

For macOS users, f2format is available through Homebrew:

brew tap jarryshaw/tap
brew install f2format
# or simply, a one-liner
brew install jarryshaw/tap/f2format

You can also install from PyPI for any OS:

pip install bpc-f2format

Or install the latest version from the Git repository:

git clone https://github.com/pybpc/f2format.git
cd f2format
pip install -e .
# and to update at any time
git pull

Note

Installation from Homebrew will also automatically install the man page and Bash Completion script for you. If you are installing from PyPI or the Git repository, you can install the completion script manually.

Usage

See Usage.

Indices and tables