fstring-to-format

fstring_to_format converts Python f-string expressions to .format() for backwards compatibility.


Keywords
f-string, fstring, format, to, converter
Licenses
GPL-3.0/GPL-3.0+
Install
pip install fstring-to-format==0.1.2

Documentation

fstring_to_format

PyPI version PyPI pyversions Python package codecov Codacy Badge PyPI download month PyPI download week PyPI download day GitHub all releases GitHub contributors CodeFactor Codacy Badge PyPI license

fstring_to_format converts Python f-string expressions to .format() for backwards compatibility.

There are other packages for this too, but this is a regular expression based cleaner solution.

Installation

Use the package manager pip to install fstring_to_format.

$ pip install fstring_to_format

# to make sure you have the latest version
$ pip install -U fstring_to_format

# latest available code base
$ pip install -U git+https://github.com/eftalgezer/fstring_to_format.git

Usage

$ python -m fstring_to_format filename.py # for a single file
$ python -m fstring_to_format *.py # for all Python files in a directory

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

GNU General Public License v3.0