quoterprovides simple transformations that could be alternatively implemented as a series of small functions. The problem is that such “little functions” tend to be constantly re-implemented, in different ways, and spread through many programs. That need to constantly re-implement such common tasks has led me to re-think how software should construct text on a grander scale.
quoteris one facet of a project to systematize higher-level formatting operations. See say and show for other parts of the larger effort.
quoteris a test case for, and leading user of, options, a module that supports flexible option handling. In some ways it is
optionsmost extensive test case, in terms of subclassing and dealing with named styles.
- In the future, additional quoting styles might appear.
There is already (limited, experimental) support for Markdown,
and other languages such as RST are straightforward. It’s not
hard to subclass
Quoterfor new languages. Some of the things learned in the
sayproject about text block management (indentation, wrapping, and such) are highly applicable to the quoting mission.
- You might look at some of the modules for ANSI-coloring text such as
ansicolors as being
special cases of the
quoterdoesn’t provide this specific kind of wrapping, it’s in-line with the mission.
- Automated multi-version testing managed with the wonderful pytest, pytest-cov, coverage, and tox. Continuous integration testing with Travis-CI. Packaging linting with pyroma.
- Successfully packaged for, and tested against, all late-model versions of Python: 2.6, 2.7, 3.3, 3.4, 3.5, and 3.6, as well as recent builds of PyPy and PyPy3.
- The author, Jonathan Eunice or @jeunice on Twitter welcomes your comments and suggestions.