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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sprettify-0.0.3.tar.gz | 3.7 kB | Without provenance | Details for sprettify-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sprettify-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for sprettify-0.0.3-py3-none-any.whl |
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
|
Security for SPrettify 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.