Skip to main content

Formatizer

Build Status Coverage Status

Formatizer Logo

Awesome artwork provided courtesy of Open Clip Art Library

Formatizer provides literal string formatting for Python versions older than 3.6. This replaces the need for substitution using % or the format function.

Formatizer is covered by unit tests and Flake8 compliance. Please note that this library does use eval to perform its expression processing.

Quick Start

Install Formatizer in your virtualenv as follows:

pip install formatizer

And now, go ahead and use the f function similarly to PEP 498:

from __future__ import print_function
from formatizer import f

GREETING = 'hi'

def main():
    name = 'Fotis'
    print(f('My name is {name}, I say {GREETING} and 1 + 2 is {1 + 2}'))

if __name__ == '__main__':
    main()

All local and global variables will be recognised by the f function and complete Python expressions are also allowed between the braces much like Python 3.6.

Metadata

Release files for formatizer 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for formatizer 0.1.1
File Size Uploaded
formatizer-0.1.1.tar.gz 3.7 kB Details

Release files / formatizer-0.1.1.tar.gz

Download URL formatizer-0.1.1.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3061ced1daa08f1836b79f4a3de16a33a54179331273e0b9c757d27ab339c29f
BLAKE2b-256 checksum
How to use checksums
60ff06524217a4497224022576f39f12f72a108921ac0033f69660abd24346ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.1 This release

1 release file

0.1

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page