Skip to main content

A library that clumps up general useful use cases for string prettifying

Reason this release was yanked:

Broken

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sprettify-0.0.1.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sprettify-0.0.1-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file sprettify-0.0.1.tar.gz.

File metadata

  • Download URL: sprettify-0.0.1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for sprettify-0.0.1.tar.gz
Algorithm Hash digest
SHA256 cc045419aaeb865676365f435fea695d755170c03341149cdd5cf85f9b3cd6c2
MD5 51f557cf3a6b7b353f77591e02c63a63
BLAKE2b-256 5117a5031a60cf70cd8980bfb6ff05cdab67aabfab24d4b589c7f169d2292fa1

See more details on using hashes here.

File details

Details for the file sprettify-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: sprettify-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for sprettify-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 826078f46b0c44732efc3bfd7f366be6b12a65ab70ea787e63e8bdc32b48afe9
MD5 9337a5001b4ec3b30cb17306928f4aef
BLAKE2b-256 013330c29321e0f966662621bbe3bc33952fb4455dff4d43e5a71e62950dbfbb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page