future-fstrings
A backport of fstrings to python<3.6
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- 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.
- Installation is straightforward with low friction, but the package is abandoned as of 2022-01-15 with no active maintenance.
License · maintenance · safety
MIT (permissive) — MIT license permits free use, modification, and distribution with minimal restrictions, making it safe to adopt from a licensing perspective.
last release 2019-06-16 (2616 days) · last repo commit 2022-01-15 · 389 stars · archived
0 known vulnerabilities (OSV.dev, 2026-08-14) · 749,735 downloads/mo, #5,160 on PyPI
Alternatives
Verify before relying
# 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)))- 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.
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 on this page. Verify before relying on it.
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
future-fstrings on PyPI
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.
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.
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)))
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 the current Python release >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagetokenize-rt |
| Maintenance | Abandoned 2,616 days since the last release |
| Last repo commit | repository archived |
| First released | |
| Downloads | 749,735 / month, #5,160 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy |
Evidence: future_fstrings-1.2.0-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “f-string backport python 2.7”
- future-fstringsEnables f-string syntax in Python versions before 3.6 by…
- functools32Backport of Python 3.2's functools module (including lru_cache…
- inspect2Provides the Python 3.6 inspect module API on Python 2.7 and 3.2–3.5,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also flake8-use-fstring · flynt · flake8-pep3101 · shellescape · backports.csv · tokenize-rt · pyupgrade · typing · traceback2 · eval-type-backport