Skip to main content

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 end and flush parameters to the underlying print() function.
  • Compatible with Python 3.3+

License

Licensed under the GNU Affero General Public License, or AGPL.

Metadata

Release files for center-text 0.1.0

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

Source distribution (sdist)

Source distribution for center-text 0.1.0
File Size Uploaded Provenance Actions
center_text-0.1.0.tar.gz 13.4 kB Without provenance Details for center_text-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for center-text 0.1.0
File Interpreter ABI Platform Actions
center_text-0.1.0-py3-none-any.whl Python 3 none any Details for center_text-0.1.0-py3-none-any.whl

Total release size: 27.2 kB

Release files / center_text-0.1.0.tar.gz

Download URL center_text-0.1.0.tar.gz
Size 13.4 kB
Tags Source
SHA-256 checksum
How to use checksums
346ebae18c9f1fd70f28c18c0e1c48635d5b54edb6181c30867a9a3e65dfbc89
BLAKE2b-256 checksum
How to use checksums
64dbebf7cfe1a074cd9c87f55b95e22de7551c099e9fafd4bc24b449d04320c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release files / center_text-0.1.0-py3-none-any.whl

Download URL center_text-0.1.0-py3-none-any.whl
Size 13.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0de43b8c672b502f131110fe03c871113549b1df9cac268e4d8f08067668726c
BLAKE2b-256 checksum
How to use checksums
7d0c136a4404d6ae5cf5e1e561d556ab7165803b1b4378bc2fcf28148e006106
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Security for center-text 0.1.0

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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