Skip to main content

leftpad

Left pad a string in Python. Created to try out making a pip package and uploading it to the Python Package Index (PyPI). Inspired by the left-pad package on npm which broke parts of the internet.

Install

pip install leftpad

Usage

from leftpad import left_pad

left_pad("foo", 5)
// => "  foo"

left_pad("foobar", 6)
// => "foobar"

left_pad(1, 2, '0')
// => "01"

left_pad(17, 5, 0)
// => "00017"

Testing

Run python -m doctest leftpad.py.

Metadata

Release files for leftpad 0.1.2

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

Source distribution (sdist)

Source distribution for leftpad 0.1.2
File Size Uploaded
leftpad-0.1.2.tar.gz 1.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for leftpad 0.1.2
File Interpreter ABI Platform
leftpad-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 3.3 kB

Release files / leftpad-0.1.2.tar.gz

Download URL leftpad-0.1.2.tar.gz
Size 1.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e38a2ebc18e0ce3adb4116708c9d8b0ec1d15414eafa4d236be7db893e8dc911
BLAKE2b-256 checksum
How to use checksums
8ca4174ed26c7165bdcdc3e612c1bba756b4c2f405bef6fcee4063481a981d0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / leftpad-0.1.2-py3-none-any.whl

Download URL leftpad-0.1.2-py3-none-any.whl
Size 1.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8ff2df0f8dbe6537d7f5f7cfb579b628ee81d02556971f2bb5992f6dffacc60e
BLAKE2b-256 checksum
How to use checksums
c292b15f48c2fb7c18ff0a21d77c6c1e0f3ae743b8d5b0516841cd290ec5e283
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

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