Metadata-Version: 2.5
Name: a-a-a-a-a
Version: 0.0.2
Summary: Flatten nested iterables to a chosen depth.
Project-URL: Homepage, https://github.com/lqxnjk/a-a-a-a-a
Author: lqxnjk
License: MIT
License-File: LICENSE
Keywords: depth,flatten,iterable,list,nested
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# a-a-a-a-a

Flatten arbitrarily nested lists, tuples, sets and dicts — with an optional
depth limit, and without ever splitting a string into characters.

## Install

```console
pip install a-a-a-a-a
```

## Usage

```python
from a_a_a_a_a import flatten

flatten([1, [2, [3, [4]]]])          # [1, 2, 3, 4]
flatten([1, [2, [3, [4]]]], 2)       # [1, 2, 3, [4]]
flatten(["ab", ["cd"]])              # ['ab', 'cd']   strings stay whole
flatten([{"a": 1}, [2]])             # [1, 2]         dict values are descended
```

## Rules

| Input type | Treated as |
| --- | --- |
| `str` / `bytes` / `bytearray` | leaf (never split) |
| `dict` | container of its **values** |
| other iterable | container |
| anything else | leaf |

`flatten_iter` streams instead of materializing, so it is safe on deep or long
inputs.

## License

MIT
