Metadata-Version: 2.1
Name: columnify
Version: 0.0.1
Summary: Create text-based columnified content suitable for console output from list of strings
Project-URL: Issues, https://github.com/changyuheng/columnify.py/issues
Project-URL: Source, https://github.com/changyuheng/columnify.py
Author-email: Johann Chang <mr.changyuheng@gmail.com>
Classifier: Development Status :: 5 - Production/Stable
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# columnify

[![PyPI - Version](https://img.shields.io/pypi/v/columnify.svg)](https://pypi.org/project/columnify)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/columnify.svg)](https://pypi.org/project/columnify)

-----

**Table of Contents**

- [Quick Start](#quick-start)
- [Installation](#installation)
- [API](#api)
  - [Methods](#methods)
- [License](#license)

## Quick Start

### Source

```py
import shutil

import columnify


given: list[str] = [
  "Canidae",
  "Felidae",
  "Cat",
  "Cattle",
  "Dog",
  "Donkey",
  "Goat",
  "Guinea pig",
  "Horse",
  "Pig",
  "Rabbit",
  "Fancy rat varieties",
  "laboratory rat strains",
]

output: str = columnify.columnify(given, shutil.get_terminal_size().columns)

print(output)
```

### Result

```
Canidae  Cat     Dog     Goat        Horse  Rabbit               laboratory rat strains
Felidae  Cattle  Donkey  Guinea pig  Pig    Fancy rat varieties
```

## Installation

```console
pip install columnify
```

## API

### Methods

```py
output: str = \
    columnify(
        items: list[str],
        line_width: int,
        indent: int = 0,
        delimiter: str = '  ',
        horizon_first: bool = False) -> str
```

## License

`columnify` is distributed under the terms of the [MPL-2.0](https://spdx.org/licenses/MPL-2.0.html) license.
