Metadata-Version: 2.4
Name: listele
Version: 3.0.0
Summary: Just a printing listed version function.
Author: Esat Saygın
License-Expression: MIT
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# listele

Returns the given iterable in a columnar format as a string.

---

```python
listele(li, column, /, *, spaces=30, find="", regex="", vertical=False) -> str
```

| Parameter | Description |
|-----------|-------------|
| `li` | A list or dict to display. Dicts are formatted as "key: value". |
| `column` | Number of columns in output. |
| `spaces` | Minimum width of each column. |
| `find` | Case-insensitive substring filter. |
| `regex` | Regex pattern to filter elements (uses match). |
| `vertical` | If True, fill columns top-to-bottom instead of left-to-right. |

| Return | Description |
|--------|-------------|
| `str` | Formatted string. |

| Raises | Description |
|--------|-------------|
| `TypeError` | If `li` is not iterable. |
| `ValueError` | If `column` or `spaces` are invalid, or `vertical` is not supported for the given input. |

---

## Examples

**Basic usage:**

```python
print(listele(range(1, 13), 4))
```

```
1                             2                             3                             4
5                             6                             7                             8
9                             10                            11                            12
```

**Filtering with `find`:**

```python
li = ['apple', 'apricot', 'banana', 'cherry', 'avocado', 'blueberry']
print(listele(li, 3, find="a"))
```

```
apple                         apricot                       banana
avocado
```

**Filtering with `regex`:**

```python
li = ['file1.txt', 'file2.txt', 'image1.png', 'image2.png', 'data.csv']
print(listele(li, 3, regex=".*\\.txt$"))
```

```
file1.txt                     file2.txt
```

**Vertical (top to bottom):**

```python
print(listele(range(1, 10), 3, vertical=True))
```

```
1                             4                             7
2                             5                             8
3                             6                             9
```

**Dictionary:**

```python
d = {'name': 'Ali', 'age': 25, 'city': 'Istanbul', 'job': 'dev', 'lang': 'Python', 'tool': 'vim'}
print(listele(d, 2, spaces=25))
```

```
name: Ali                age: 25
city: Istanbul           job: dev
lang: Python             tool: vim
```
