Formatizer
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.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| formatizer-0.1.2.tar.gz | 4.1 kB | Without provenance | Details for formatizer-0.1.2.tar.gz |
Release files / formatizer-0.1.2.tar.gz
| Download URL | formatizer-0.1.2.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c7a07f04493c525fef79c56a69f90991be6eb43850087fec9b581182d2ecf0ca
|
|
BLAKE2b-256 checksum How to use checksums |
7679624c09ee62df745a617cdeb398a82304a56f991187afe983e97a34a1f301
|
| 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.2
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.