Skip to main content

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

pip install a-a-a-a-a

Usage

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

Metadata

Release files for a-a-a-a-a 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for a-a-a-a-a 0.0.2
File Size Uploaded Provenance
a_a_a_a_a-0.0.2.tar.gz 2.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for a-a-a-a-a 0.0.2
File Interpreter ABI Platform
a_a_a_a_a-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 6.3 kB

Release files / a_a_a_a_a-0.0.2.tar.gz

Download URL a_a_a_a_a-0.0.2.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ab58cd53fc90c9d868b83a692856eed3078060083281b46fdd4c8fb059f19663
BLAKE2b-256 checksum
How to use checksums
236a8d2a02f73296b9a9e9bca441bbb4007cb950298c8ec5615fa08403f2f11b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.11

Release files / a_a_a_a_a-0.0.2-py3-none-any.whl

Download URL a_a_a_a_a-0.0.2-py3-none-any.whl
Size 3.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ffedbe487a907286693accd8148a9521338bf134ebfe5d2b2450104fa199139
BLAKE2b-256 checksum
How to use checksums
65e6fc5b3e7536578e5352a7e09964a1e1cbdb3ec2b9b3a183539644e12e0e09
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.11

Security for a-a-a-a-a 0.0.2

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page