Skip to main content

Formatizer

License Latest Version Python Versions

Formatizer Logo

Artwork courtesy of Open Clip Art Library

Introduction

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.

Running Tests

You may run the unit tests as follows:

git clone https://codeberg.org/fgimian/formatizer.git
cd formatizer
python setup.py test

License

Formatizer is released under the MIT license. Please see the LICENSE file for more details.

Metadata

Release files for formatizer 0.1.3

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.3
File Size Uploaded Provenance Actions
formatizer-0.1.3.tar.gz 4.2 kB Without provenance Details for formatizer-0.1.3.tar.gz

Release files / formatizer-0.1.3.tar.gz

Download URL formatizer-0.1.3.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2892bd8a33af40ae60307e0e53e97fca7f2500088f961a92318feff41a11aa73
BLAKE2b-256 checksum
How to use checksums
f272299e98bbdae3874cbaddca62f71675934a48c8ea26990fe7e8859051a5bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Security for formatizer 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.3 This release

1 release file No provenance

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