Python printer configurations.
Project description
ConfPrint
Copyright 2021 Lewi Lie Uberg
Released under the MIT license
ConfPrint provides a simple way to make predefined printer configurations.
Contents
Citation
Please see CITATION.cff for the full citation information.
APA
Lie Uberg, L., & Hjelle, G. A. (2021). confprint (Version 0.1.1) [Computer software]. https://github.com/lewiuberg/confprint
BibTex
@software{Lie_Uberg_confprint_2021,
author = {Lie Uberg, Lewi and Hjelle, Geir Arne},
license = {MIT},
month = {10},
title = {{confprint}},
url = {https://github.com/lewiuberg/confprint},
version = {0.1.1},
year = {2021}
}
Prerequisites
Please see pyproject.toml for the full citation information.
Installation
Using pip:
python -m pip install confprint
Using Poetry:
poetry add confprint
Usage
prefix_printer
from confprint import prefix_printer
p_test1 = prefix_printer(prefix="test1")
p_test1("Preset")
p_test2 = prefix_printer(prefix="test2", upper=False)
p_test2("unaltered text")
p_test3 = prefix_printer(prefix="test3", stderr=True)
p_test3("using sys.stderr.write as the print function")
p_test4 = prefix_printer(prefix="test4", click=True)
p_test4("using click.echo as the print function")
p_test5 = prefix_printer(prefix="test5", frame_left="( ", frame_right=" )")
p_test5("using custom frame characters")
p_test1(
"""With new lines in strings the text is converted
to multiline, then all but the first are
indented to line up with therest."""
)
p_test1(
"The next example wil not be ending with a `:`, "
"since it has no input.\nAnd as you can see, this is also a multiline text."
)
p_done = prefix_printer(prefix="done")
p_done()
[TEST1]: Preset
[test2]: unaltered text
[TEST3]: using sys.stderr.write as the print function
[TEST4]: using click.echo as the print function
( TEST5 ): using custom frame characters
[TEST1]: With new lines in strings the text is converted
to multiline, then all but the first are
indented to line up with therest.
[TEST1]: The next example wil not be ending with a `:`, since it has no input.
And as you can see, this is also a multiline text.
[DONE]
Authors
License
This project is licensed under the MIT License - see the LICENSE file for details
Acknowledgments
- Geir Arne Hjelle, for his presentation on 'Introduction to Decorators' given at PyCon 21
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
confprint-0.1.2.tar.gz
(5.8 kB
view hashes)
Built Distribution
Close
Hashes for confprint-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d80c47e6060ced19be1733a3ff12ac0873e8f7c47ff51391383db04cce2ad4ce |
|
MD5 | 4f8662b9c454c86cd5b8008784618d7f |
|
BLAKE2b-256 | 50fcaa76abc48393aff91d47a9184ac9acc2f67ab8cb465ddf7b7620ced01b94 |