columnify
Inspired by columnify.
columnify creates text-based columnized (ls-like) content suitable for console output from list of strings.
Columns are automatically resized to fit the content of the largest cell. Each cell will be padded with spaces to fill the available space and ensure column contents are aligned.
Table of Contents
Examples
items: list[str] = [
"Canidae", "Felidae", "Cat", "Cattle", "Dog",
"Donkey", "Goat", "Guinea pig", "Horse", "Pig",
"Rabbit", "Fancy rat varieties", "laboratory rat strains",
]
Default
Canidae Cat Dog Goat Horse Rabbit laboratory rat strains
Felidae Cattle Donkey Guinea pig Pig Fancy rat varieties
Horizon first
Canidae Felidae Cat Cattle Dog Donkey Goat
Guinea pig Horse Pig Rabbit Fancy rat varieties laboratory rat strains
center()
Canidae Cat Dog Goat Horse Rabbit laboratory rat strains
Felidae Cattle Donkey Guinea pig Pig Fancy rat varieties
rjust()
Canidae Cat Dog Goat Horse Rabbit laboratory rat strains
Felidae Cattle Donkey Guinea pig Pig Fancy rat varieties
Custom delimiter ( | )
Canidae | Cattle | Goat | Pig | laboratory rat strains
Felidae | Dog | Guinea pig | Rabbit
Cat | Donkey | Horse | Fancy rat varieties
Indent (4 spaces):
Canidae Cattle Goat Pig laboratory rat strains
Felidae Dog Guinea pig Rabbit
Cat Donkey Horse Fancy rat varieties
See examples/example.py for more information.
Installation
pip install columnify
API
Methods
def columnify(
items: list[str],
line_width: int,
indent: int = 0,
delimiter: str = ' ',
align_func_name: str = 'ljust',
horizon_first: bool = False) -> str:
...
License
columnify is distributed under the terms of the MPL-2.0 license.
Metadata
Release files for columnify 1.0.1
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 |
|---|---|---|---|---|
| columnify-1.0.1.tar.gz | 10.8 kB | Without provenance | Details for columnify-1.0.1.tar.gz |
Release files / columnify-1.0.1.tar.gz
| Download URL | columnify-1.0.1.tar.gz |
|---|---|
| Size | 10.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1980efbe3c2b47e1b2a0f6f77ab346e57ea0182bc1a23a492d33f00483317004
|
|
BLAKE2b-256 checksum How to use checksums |
b48b6b496b5cdddd92172d0a4d2718f8d8e487f927d25c316deea19d6c17eb2f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-httpx/0.23.0
|
Security for columnify 1.0.1
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.