--- id: future-fstrings version: "1.2.0" license: MIT license_treatment: permissive maintenance: abandoned --- # future-fstrings — A backport of fstrings to python<3.6 License: permissive · Maintenance: abandoned · Downloads: 749.7K/mo ## What it is and what it does future-fstrings is a codec-based backport that allows you to write Python 3.6+ f-string syntax and run it on Python 2.7 and Python 3.4–3.5. You add a special encoding cookie to the top of your file, and the package intercepts the source at import time, rewriting f-strings into equivalent `.format()` calls before the Python interpreter sees them. This works by registering a custom UTF-8 codec on startup that uses tokenize-rt to perform the transformation. The package also provides a command-line tool (`future-fstrings-show`) to pre-transform source files, useful for distributing code to platforms like micropython that don't support f-strings at all. However, the project is archived and no longer maintained, so it will not adapt to future Python changes or receive security updates. Use it for: - Maintain a single f-string codebase that runs on Python 2.7 and early Python 3 versions without duplicating syntax. - Pre-transform source code before deploying to micropython or other embedded platforms that lack f-string support. - Gradually migrate legacy Python 2.7 codebases to modern f-string syntax while maintaining backward compatibility during transition. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Enables f-string syntax in Python versions before 3.6 by transparently rewriting f-strings to `.format()` calls at import time via a custom codec. No. The package is abandoned (last updated 2022-01-15) and targets Python versions that are themselves end-of-life. If you need f-strings on older Python, this was useful historically, but new projects should target Python 3.6+. Existing projects still on unsupported Python versions should prioritize upgrading rather than relying on unmaintained backports. ## Install pip install future-fstrings uv add future-fstrings poetry add future-fstrings ## Installing future-fstrings Before you install: Installation is straightforward with low friction, but the package is abandoned as of 2022-01-15 with no active maintenance. It was last released on 2019-06-16, so it will not receive updates for new Python versions or security issues. License in practice: MIT license permits free use, modification, and distribution with minimal restrictions, making it safe to adopt from a licensing perspective. Quickstart: # Install pip install future-fstrings # At the top of your .py file, add: # -*- coding: future_fstrings -*- # Then write f-strings normally: thing = 'world' print(f'hello {thing}') # Run on Python 2.7 or 3.4–3.5; the codec rewrites it to: # print('hello {}'.format((thing))) Requires Python 2.7 or 3.4–3.5 to run with the codec active; Python 3.6+ natively supports f-strings and does not need this package. The encoding cookie must be the first or second line of the file. Verify before relying: - Whether the codec approach remains reliable on modern Python interpreters beyond the versions it was tested against. - Compatibility with third-party tools that parse or analyze Python source code (linters, type checkers, etc.). - Whether Python 2.7 and Python 3.4–3.5 remain viable targets for new projects using this package. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: abandoned - Downloads: 749.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags f-string backport python 2.7, fstring support older python, python 2 f-strings, format string compatibility, micropython f-string rewrite, legacy-python, syntax-transformation, codec [View on SkillFed](https://skillfed.io/packages/future-fstrings) · [View on PyPI](https://pypi.org/project/future-fstrings/)