Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/egeakman/style-print
Print with style from the command line!
https://github.com/egeakman/style-print
color console print printy style terminal utility
Last synced: 23 days ago
JSON representation
Print with style from the command line!
- Host: GitHub
- URL: https://github.com/egeakman/style-print
- Owner: egeakman
- License: agpl-3.0
- Created: 2023-02-11T06:20:59.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-02-11T19:26:45.000Z (almost 2 years ago)
- Last Synced: 2024-11-27T20:37:48.004Z (30 days ago)
- Topics: color, console, print, printy, style, terminal, utility
- Language: Python
- Homepage:
- Size: 15.6 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# style-print
style-print is a utility CLI for formatting and printing text in different styles. It uses the ``printy`` library for color and formatting options.
## Installation
- Install the package using pip:
```bash
pip install style-print
```- Pre-commit hook:
```yaml
repos:
- repo: local
hooks:
- id: style-print
name: style-print
entry: style-print "This is a test" "r>UBI{b}"
language: python
additional_dependencies: ["style-print"]
pass_filenames: false
verbose: true
```## Usage
### Command line usage
style-print can be used from the command line using the ``style-print`` command. The script takes three arguments:
- *positional* ``text``: The text to be printed, or the ``?gimme`` command
- *optional* ``options``: The options for formatting the text
- *info* ``?gimme``: A special text that prints the available colors and formats
- *optional* ``-d`` or ``--disable-gimme``: A flag that disables the default behavior when the ``text`` is equal to ``"?gimme"``.#### *Text*
The text argument is the text to be printed. If the text is equal to ``"?gimme"``, then the available colors and formats are printed. This behavior can be disabled by passing the ``-d`` or ``--disable-gimme`` flag. You must use double quotes if you want to print a string that contains spaces.
#### *Options*
The options argument is used to pass the formatting options to ``printy``. The options are passed in a string format. You must use double quotes if you want to use background colors or colors with greater than or smaller than signs. For example, to set the text color to light red and background color to blue and underlined-bold-italic, you can pass the option ``"r>UBI{b}"``.
For more information on the options available, see the ``printy`` library documentation: https://github.com/edraobdu/printy#list-1-flags
### In code usage
Just use the ``printy`` library itself. The ``style-print`` package is just a wrapper around the ``printy`` library for command line usage.
## Issues
If you run into any issues, please open an issue on the GitHub repository: https://github.com/egeakman/style-print/issues
## License
This project is licensed under the AGPL-3.0 License - see the [LICENSE](LICENSE) file for details