Function to center text in the terminal
Project description
center-text
Python module to center text in the terminal.
This is my first Python module ever, so it's also where I learned to create modules for pypi, and was more so a learning experience than anything.
Installation
Install the package directly from PyPI using pip:
pip install center-text
Usage
from center import center_text
# Center text using standard spaces
center_text('Hello, World!')
# Center text using custom padding characters
center_text(' wow ', pad_str='~')
center_text(' casino ', pad_str=' 777 ')
Features
- Auto-detects terminal width
- Supports custom padding strings of any length
- Forwards standard
endandflushparameters to the underlyingprint()function. - Compatible with Python 3.3+
License
Licensed under the GNU Affero General Public License, or AGPL.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file center_text-0.1.0.tar.gz.
File metadata
- Download URL: center_text-0.1.0.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
346ebae18c9f1fd70f28c18c0e1c48635d5b54edb6181c30867a9a3e65dfbc89
|
|
| MD5 |
0dc2e84634e5bb7a047191f5f50f1c5f
|
|
| BLAKE2b-256 |
64dbebf7cfe1a074cd9c87f55b95e22de7551c099e9fafd4bc24b449d04320c1
|
File details
Details for the file center_text-0.1.0-py3-none-any.whl.
File metadata
- Download URL: center_text-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0de43b8c672b502f131110fe03c871113549b1df9cac268e4d8f08067668726c
|
|
| MD5 |
b8d78fa4e415363558c821d3fe1112b7
|
|
| BLAKE2b-256 |
7d0c136a4404d6ae5cf5e1e561d556ab7165803b1b4378bc2fcf28148e006106
|