Skip to main content

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:

    pip install style-print
    
  • Pre-commit hook:

    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 file for details

Metadata

Release files for style-print 2023.2.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for style-print 2023.2.11
File Size Uploaded
style-print-2023.2.11.tar.gz 15.0 kB Details

Release files / style-print-2023.2.11.tar.gz

Download URL style-print-2023.2.11.tar.gz
Size 15.0 kB
Tags Source
SHA-256 checksum
How to use checksums
9b17e5aefc9a83d45b1268bb45f96ec2f4792dbbcf2fe967ad1065e99cf400a2
BLAKE2b-256 checksum
How to use checksums
61d7018876e7ec17569bfe1b59d6f7ecfed28470c11f8e1e90ba08457c77f997
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.0

Release history Release notifications | RSS feed

This release

2023.2.11 This release

1 release file

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