Skip to main content

Developers Toolbox

Draw Lines

Draw a coloured rule in the terminal. Put optional text on the left, in the centre, or on the right. The fill character, padding, width, and colour are all optional.

Install

pip install lupaxa-draw-lines

Requires Python 3.10+. The only runtime dependency is colorama.

Library

from lupaxa.draw_lines import draw_line

Solid Rule

Empty text draws one unbroken line. This one is 90 dashes.

print(draw_line(width=90))

Centred Text

The words sit in the middle. fill_char=" " uses spaces instead of dashes.

print(draw_line(text="Hello, World!", position="center", fill_char=" ", width=90))

Text on the Left

The words sit flush left. The default pad of 2 puts two dashes before them, then a space.

print(draw_line(text="Hello, World!", position="left", width=90))

Text on the Right

The same padding sits on the right edge, and the dashes fill in from the left.

print(draw_line(text="Hello, World!", position="right", width=90))

Cyan Text

Only the words are coloured. The dashes stay plain.

print(draw_line(text="Hello, World!", position="right", width=90, color="cyan"))

Bold Text

bold is a bright style with no hue of its own.

print(draw_line(text="Hello, World!", position="right", width=90, color="bold"))

Cyan and Bold

Join a colour and bold with +. Order can be cyan+bold or bold+cyan.

print(draw_line(text="Hello, World!", position="right", width=90, color="cyan+bold"))

Colour with Extra Characters

Spaces and punctuation are ignored, so this is the same call as cyan+bold.

print(draw_line(text="Hello, World!", position="right", width=90, color="cyan   +    bold#$%"))

Terminal Width

Leave width at its default of -1 and the line matches the terminal, minus one column.

print(draw_line(text="Hello, World!", position="center"))

No Side Padding

pad=0 drops the extra dashes beside left or right text. A single space still separates the words from the rule.

print(draw_line(text="Hello, World!", position="left", pad=0, width=90))

Parameters

Parameter Default What it Does
text "" Text on the line. An empty string draws one unbroken rule.
position center left, center, or right. Any other value raises ValueError.
fill_char - Rule and padding character. Only the first character is used.
pad 2 Fill characters beside left or right text. Centred text always has one space on each side. A negative value raises ValueError.
width -1 Column count. -1 uses the terminal width minus one column. 0 returns an empty string.
color "" Colour of the text. A name, bold, or both joined with +. Empty leaves the text uncoloured.

Colour

Pass a colour name, bold, or both joined with +. Spaces and punctuation are ignored, so cyan + bold#$% is the same as cyan+bold.

Name What it Does
black Black foreground.
blue Blue foreground.
cyan Cyan foreground.
green Green foreground.
grey Grey foreground.
magenta Magenta foreground.
red Red foreground.
white White foreground.
yellow Yellow foreground.
bold Bright style. Use alone, or with a colour as cyan+bold or bold+cyan.
reset Clears colour and style.

Development

make init
make python-install-dev
make python-check
The Lupaxa Project Footer

Metadata

Release files for lupaxa-draw-lines 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 lupaxa-draw-lines 0.1.0
File Size Uploaded Provenance Actions
lupaxa_draw_lines-0.1.0.tar.gz 6.1 kB With provenance Details for lupaxa_draw_lines-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lupaxa-draw-lines 0.1.0
File Interpreter ABI Platform Actions
lupaxa_draw_lines-0.1.0-py3-none-any.whl Python 3 none any Details for lupaxa_draw_lines-0.1.0-py3-none-any.whl

Total release size: 13.1 kB

Release files / lupaxa_draw_lines-0.1.0.tar.gz

Download URL lupaxa_draw_lines-0.1.0.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
027751628c67ab79da9337e39151dbf10ff8fd6b7795d3d741f8c066aef7bc6e
BLAKE2b-256 checksum
How to use checksums
c9e4c5a9ed0f187765e4702bceb700c7b826ba511eaa164663ad88a3427db9ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

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

Download URL lupaxa_draw_lines-0.1.0-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7b9650d88df978b2b4888ee9d93aa8ee76a384a907ad1700e5c3832240e03019
BLAKE2b-256 checksum
How to use checksums
635cc87225047e6d923c35ec46e8bf5a1eec98e416897dc9c1485b338900c51d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Security for lupaxa-draw-lines 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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for lupaxa_draw_lines-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

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 Full 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