Skip to main content

Format a simple (i.e. not nested) list into aligned columns.

Project description

Return a list of strings as a compact set of columns arranged
horizontally or vertically.

For example, for a line width of 4 characters (arranged vertically):
['1', '2,', '3', '4'] => '1 3\n2 4\n'

or arranged horizontally:
['1', '2,', '3', '4'] => '1 2\n3 4\n'

Each column is only as wide as necessary. By default, columns are
separated by two spaces - one was not legible enough. Set "colsep"
to adjust the string separate columns. Set `displaywidth' to set
the line width.

Normally, consecutive items go down from the top to bottom from
the left-most column to the right-most. If +arrange_vertical+ is
set false, consecutive items will go across, left to right, top to
bottom.

Adapted from the routine of the same name inside cmd.py


0.3.5

- Reinstate ability to run on older Pythons. In particular Python
2.4.6 and 2.5.6 now. I suppose other version in between work too.

- Add opts hash to bundle the growing options old and new:
* arrange_array
* arrange_vertical
* arrange_horizontal
* array_prefix
* array_suffix
* colsep
* colfmt
* displaywidth
* lineprefix
* linesuffix
* ljust

- Fixes to make source tarball work. (Added test files properly)

0.3.4 01-03-13
- Make 3k tolerant. This means it no longer works for versions less
than Python 2.6.

0.3.3 10-28-10 -
- Work on packaging
- Remove pyflakes warnings
- Correct licensing information

0.3.2 03-08-09 - Ron Frankel -1 Release

- Relax restriction that array has to be string. Now is just something
we can call str() on each of the elements on.

- Correct bug in vertical alignment

- Add an optional initial line prefix string

0.3.1 01-10-09 - Sam Woodward Release
- Some small typos fixed.

0.3.0 01-05-09

- 0.2.0 had bad bugs - don't use.
Allow specifying right justification as well as left justification

0.2.0 12-31-08

- Add ability to run columns vertically

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

columnize-0.3.5.tar.gz (8.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

columnize-0.3.5-py3.3.egg (8.3 kB view details)

Uploaded Egg

columnize-0.3.5-py3.2.egg (8.2 kB view details)

Uploaded Egg

columnize-0.3.5-py2.7.egg (8.1 kB view details)

Uploaded Egg

columnize-0.3.5-py2.6.egg (8.2 kB view details)

Uploaded Egg

columnize-0.3.5-py2.5.egg (8.2 kB view details)

Uploaded Egg

columnize-0.3.5-py2.4.egg (8.2 kB view details)

Uploaded Egg

File details

Details for the file columnize-0.3.5.tar.gz.

File metadata

  • Download URL: columnize-0.3.5.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for columnize-0.3.5.tar.gz
Algorithm Hash digest
SHA256 a6f2d3b7c3ee154c2245f523a581d25cf5465ba8ff16b936ef4ce394ff0abc36
MD5 0274bdeeecb2dff9eb4306b0c848b281
BLAKE2b-256 34753907ad5a5c517fa84e22b0e2f473463c73e0904779a1303657cdc77c76fa

See more details on using hashes here.

File details

Details for the file columnize-0.3.5-py3.3.egg.

File metadata

  • Download URL: columnize-0.3.5-py3.3.egg
  • Upload date:
  • Size: 8.3 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for columnize-0.3.5-py3.3.egg
Algorithm Hash digest
SHA256 88b1de652780976bd3ed71a1dc2357b363510853c065151404a386d13969e19a
MD5 2ecbbbb6c678e046981d418b2c24d6fe
BLAKE2b-256 c8a5a98dfcc2ac6dc4ddf906ae03d3042c62dc56c662bca14745add74154b69f

See more details on using hashes here.

File details

Details for the file columnize-0.3.5-py3.2.egg.

File metadata

  • Download URL: columnize-0.3.5-py3.2.egg
  • Upload date:
  • Size: 8.2 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for columnize-0.3.5-py3.2.egg
Algorithm Hash digest
SHA256 bbfd67f1ab6d5409b29495467c68d0169143341360f602755b16a718d86b150a
MD5 923b165405d0ded8f82758dfea77b8bd
BLAKE2b-256 7c86bc47e213832a607f3ee4bc3865f025c93986769d66a0dd035e918c2b33f2

See more details on using hashes here.

File details

Details for the file columnize-0.3.5-py2.7.egg.

File metadata

  • Download URL: columnize-0.3.5-py2.7.egg
  • Upload date:
  • Size: 8.1 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for columnize-0.3.5-py2.7.egg
Algorithm Hash digest
SHA256 03f1f37696963a6da0279cc486926023de4d6242113abf44b56023dc6d74dfcc
MD5 426e77a31c9a8d2a51f0b29a8bbfd3e5
BLAKE2b-256 086f8258372092fc1e6e4ae24721343d0bffdd265bdbe821505fef7a025e8603

See more details on using hashes here.

File details

Details for the file columnize-0.3.5-py2.6.egg.

File metadata

  • Download URL: columnize-0.3.5-py2.6.egg
  • Upload date:
  • Size: 8.2 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for columnize-0.3.5-py2.6.egg
Algorithm Hash digest
SHA256 ed26005b40238a00fd2e6c4417d0819bb1d54e2ada8a36316dd30c035585a0fa
MD5 f1c6f0f6381f888eebb30645fe50cbb5
BLAKE2b-256 d02afe72786073eaac30af99053cc3288370968eab5f26d46e049c47a285d43a

See more details on using hashes here.

File details

Details for the file columnize-0.3.5-py2.5.egg.

File metadata

  • Download URL: columnize-0.3.5-py2.5.egg
  • Upload date:
  • Size: 8.2 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for columnize-0.3.5-py2.5.egg
Algorithm Hash digest
SHA256 ef42841752a0fc01aeda28ba1154eb3188557f421d04ac8921a4c2ee1f6fbdcf
MD5 b2d3720fc7cc63dd1462e64b6c3998dd
BLAKE2b-256 0fa6c0b89d65978ab0bde4b4e8ddce864fe6483864e6f1e9141ffba4611d174a

See more details on using hashes here.

File details

Details for the file columnize-0.3.5-py2.4.egg.

File metadata

  • Download URL: columnize-0.3.5-py2.4.egg
  • Upload date:
  • Size: 8.2 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for columnize-0.3.5-py2.4.egg
Algorithm Hash digest
SHA256 cd5e27c5266a779ea2a9b4243431c2f8153934e4aece7210790526bfcbbf7418
MD5 6106f0be10a493e944b9eaebf2ff3f71
BLAKE2b-256 f4276545071920faadee3000462384f61df8d30c8b8c8a109fc15c8a9a1b3f4e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page