Skip to main content

SPrettify

A Python module for formatting and structuring strings efficiently. SPrettify helps in creating visually appealing output with alignment, headers, and a clean key-value pairs.

Features

  • Add formatted headers with horizontal tabulation.
  • Append lines with custom alignments.
  • Create structured key-value pair outputs.
  • Print or retrieve the formatted output as a string.

Installation

This module does not require any external dependencies. Just do pip install SPrettify and import it into your project.

Usage

from SPrettify import Prettify

formatter = Prettify()
formatter.define_alignment(spaces=4)  # Set left alignment

formatter.add_tab("Header", "=", 40)
formatter.add_line("This is a formatted line.")
formatter.add_sort("Key", "Value")

formatter.prettyprint()  # Print output
formatted_string = formatter.prettystring()  # Get output as a string

Methods

define_alignment(spaces=0, tabs=0)

Sets the left alignment with spaces or tabs.

add_tab(data="", char="=", lines=30)

Adds a formatted header with horizontal tabulation.

add_line(data="")

Appends a simple line with the defined alignment.

add_sort(key="", value="", separator=":", align=1)

Formats key-value pairs with custom alignment.

prettyprint()

Prints the formatted output.

prettystring()

Returns the formatted output as a string.

Found on

This project is used on GoGoDownloader-R2 It can be used as an example of its usage

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Metadata

Release files for SPrettify 0.0.3

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

Source distribution (sdist)

Source distribution for SPrettify 0.0.3
File Size Uploaded
sprettify-0.0.3.tar.gz 3.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for SPrettify 0.0.3
File Interpreter ABI Platform
sprettify-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 7.7 kB

Release files / sprettify-0.0.3.tar.gz

Download URL sprettify-0.0.3.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c6548ce053a00d0d41487a269a19ef55f051e677b2926c72c8124c6bf78b008a
BLAKE2b-256 checksum
How to use checksums
24adef8487eee9054eae4e81ba60a9a54912c0fb099ef83cc78dea02e3d30007
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release files / sprettify-0.0.3-py3-none-any.whl

Download URL sprettify-0.0.3-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
21b6744eb0222442b75c86a419767e5c7cea927050cb3475965331008edd3c80
BLAKE2b-256 checksum
How to use checksums
856db39f40ef97b153e879f2b040e8cbbd5d3a5bb5db7fac81e6c8d8aa8c84c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

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