easier access to nested lists
pip install nestedlistops
Example Usage
get_nested_item(l: Iterable, i: Iterable) -> Any
Retrieves a nested item from a given list or nested list based on the provided index sequence.
Args:
l (Iterable): The initial list or nested list.
i (Iterable): An iterable representing the index sequence to access the desired item.
Returns:
Any: The nested item at the specified index sequence.
Examples:
>>> from nestedlistops import set_nested_item, get_nested_item
>>> listas = [[[1, 2], [3, 4]], [[4, 5], [6, 7]], [[7, 8], [9, 9]]]
>>> get_nested_item(l=listas, i=(0, 1, 0))
3
set_nested_item(l: Iterable, i: Iterable, v: Any)
Sets the value of a nested item in a given list or nested list based on the provided index sequence.
Args:
l (Iterable): The initial list or nested list.
i (Iterable): An iterable representing the index sequence to access the desired item.
v (Any): The value to be assigned to the nested item.
Returns:
None (the original iterable is modified)
Examples:
>>> from nestedlistops import set_nested_item, get_nested_item
>>> listas = [[[1, 2], [3, 4]], [[4, 5], [6, 7]], [[7, 8], [9, 9]]]
>>> set_nested_item(l=listas, i=(0, 1, 0), v=1111)
>>> print(listas)
[[[1, 2], [1111, 4]], [[4, 5], [6, 7]], [[7, 8], [9, 9]]]
Metadata
Release files for nestedlistops 0.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nestedlistops-0.10.tar.gz | 3.1 kB | Without provenance | Details for nestedlistops-0.10.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nestedlistops-0.10-py3-none-any.whl | Python 3 | none | any | Details for nestedlistops-0.10-py3-none-any.whl |
Total release size: 7.4 kB
Release files / nestedlistops-0.10.tar.gz
| Download URL | nestedlistops-0.10.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9aec709846ba6bf75fa83c00c0321828d6b88da45c58a1e475fdc009f190ce6b
|
|
BLAKE2b-256 checksum How to use checksums |
8afcb3af0f13f2ac91a719067106bfdfe055b2c6c830c51f2e6b400e297997aa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.10
|
Release files / nestedlistops-0.10-py3-none-any.whl
| Download URL | nestedlistops-0.10-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9d7f1da34c90410bb99d1a01913311514715340e077f1568c53aa8c4e088d530
|
|
BLAKE2b-256 checksum How to use checksums |
8ea82815f1947b6265266075378eb4a21601571a5e054d168a93db43eaaba13b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.10
|
Security for nestedlistops 0.10
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.