set-nested-iters


Nameset-nested-iters JSON
Version 0.10 PyPI version JSON
download
home_pagehttps://github.com/hansalemaos/set_nested_iters
SummaryFinds intersections/differences in nested iterables
upload_time2023-01-02 00:51:27
maintainer
docs_urlNone
authorJohannes Fischer
requires_python
licenseMIT
keywords set nested
VCS
bugtrack_url
requirements numpy
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# Finds intersections/differences in nested iterables  


```python
# Tested with:
# Python 3.9.13
# Windows 10


$pip install set-nested-iters


from set_nested_iters import (
    present_in_L1_and_L2,
    present_in_all_lists_reduce,
    unique_in_L1_and_L2,
    unique_in_each_list_reduce,
    present_only_in_L1,
    present_only_in_L1_reduce,
)
L0 = [{2, 5}, "a", 44, "jojjo", "xxx", {77: 100}]
L1 = [
    {2, 5},
    "a",
    ["bb", ["ccc", "ddd"], "ee", "ff"],
    "g",
    "h",
    "g",
    "h",
    3,
    4,
    5,
    0.0,
    1,
]
L2 = [
    {2, 5},
    "ac",
    (98, 11),
    ["bb", ["ccc", "ddd"], "ee", "ff"],
    "gc",
    "h",
    "gc",
    "h",
    11,
    2,
    3,
    1.0,
    0.0,
]
L3 = [
    {2, 5},
    "a",
    44,
    ["bb", ["ccc", "ddd"], "ee", "ff"],
    "g",
    "h",
    "g",
    "h",
    3,
    4,
    5,
    0.0,
    1,
]
L4 = [
    {2, 5},
    "ac",
    111112,
    (98, 11),
    ["bb", ["ccc", "ddd"], "ee", "ff"],
    "gc",
    "a",
    "h",
    "gc",
    "h",
    11,
    2,
    3,
    1.0,
    0.0,
]
erg0 = present_only_in_L1(L1, L2, withindex=False)
print(erg0)
erg1 = present_only_in_L1(L2, L1, withindex=False)
print(erg1)
erg2 = unique_in_L1_and_L2(L1, L2, withindex=False)
print(erg2)
erg3 = present_in_L1_and_L2(L1, L2, withindex=False)
print(erg3)
erg0 = present_only_in_L1(L1, L2, withindex=True)
print(erg0)
erg1 = present_only_in_L1(L2, L1, withindex=True)
print(erg1)
erg2 = unique_in_L1_and_L2(L1, L2, withindex=True)
print(erg2)
erg3 = present_in_L1_and_L2(L1, L2, withindex=True)
print(erg3)
print(present_in_all_lists_reduce(L1, [L2, L3, L4]))
print(unique_in_each_list_reduce(L1, [L2, L3, L4, L0]))
print(present_only_in_L1_reduce(L0, [L2, L3, L4, L1]))



['a', 'g', 4, 5]
['ac', (98, 11), 'gc', 11, 2]
['a', 'g', 4, 5, 'ac', (98, 11), 'gc', 11, 2]
[{2, 5}, ['bb', ['ccc', 'ddd'], 'ee', 'ff'], 'h', 3, 0.0, 1]
[(1, 'a'), (3, 'g'), (6, 4), (7, 5)]
[(1, 'ac'), (2, (98, 11)), (4, 'gc'), (6, 11), (7, 2)]
[(1, 'a'), (3, 'g'), (6, 4), (7, 5), (1, 'ac'), (2, (98, 11)), (4, 'gc'), (6, 11), (7, 2)]
[(0, {2, 5}), (2, ['bb', ['ccc', 'ddd'], 'ee', 'ff']), (4, 'h'), (5, 3), (8, 0.0), (9, 1)]
[{2, 5}, ['bb', ['ccc', 'ddd'], 'ee', 'ff'], 'h', 3, 0.0, 1]
[111112, {2, 5}, 'jojjo', 'xxx', {77: 100}]
['jojjo', 'xxx', {77: 100}]
	
```





            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/hansalemaos/set_nested_iters",
    "name": "set-nested-iters",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "set,nested",
    "author": "Johannes Fischer",
    "author_email": "<aulasparticularesdealemaosp@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/b9/b0/d84c6c62c1048a77f47f064199196fe2491adc4c51e62d6737b95bbe16c7/set_nested_iters-0.10.tar.gz",
    "platform": null,
    "description": "\n# Finds intersections/differences in nested iterables  \n\n\n```python\n# Tested with:\n# Python 3.9.13\n# Windows 10\n\n\n$pip install set-nested-iters\n\n\nfrom set_nested_iters import (\n    present_in_L1_and_L2,\n    present_in_all_lists_reduce,\n    unique_in_L1_and_L2,\n    unique_in_each_list_reduce,\n    present_only_in_L1,\n    present_only_in_L1_reduce,\n)\nL0 = [{2, 5}, \"a\", 44, \"jojjo\", \"xxx\", {77: 100}]\nL1 = [\n    {2, 5},\n    \"a\",\n    [\"bb\", [\"ccc\", \"ddd\"], \"ee\", \"ff\"],\n    \"g\",\n    \"h\",\n    \"g\",\n    \"h\",\n    3,\n    4,\n    5,\n    0.0,\n    1,\n]\nL2 = [\n    {2, 5},\n    \"ac\",\n    (98, 11),\n    [\"bb\", [\"ccc\", \"ddd\"], \"ee\", \"ff\"],\n    \"gc\",\n    \"h\",\n    \"gc\",\n    \"h\",\n    11,\n    2,\n    3,\n    1.0,\n    0.0,\n]\nL3 = [\n    {2, 5},\n    \"a\",\n    44,\n    [\"bb\", [\"ccc\", \"ddd\"], \"ee\", \"ff\"],\n    \"g\",\n    \"h\",\n    \"g\",\n    \"h\",\n    3,\n    4,\n    5,\n    0.0,\n    1,\n]\nL4 = [\n    {2, 5},\n    \"ac\",\n    111112,\n    (98, 11),\n    [\"bb\", [\"ccc\", \"ddd\"], \"ee\", \"ff\"],\n    \"gc\",\n    \"a\",\n    \"h\",\n    \"gc\",\n    \"h\",\n    11,\n    2,\n    3,\n    1.0,\n    0.0,\n]\nerg0 = present_only_in_L1(L1, L2, withindex=False)\nprint(erg0)\nerg1 = present_only_in_L1(L2, L1, withindex=False)\nprint(erg1)\nerg2 = unique_in_L1_and_L2(L1, L2, withindex=False)\nprint(erg2)\nerg3 = present_in_L1_and_L2(L1, L2, withindex=False)\nprint(erg3)\nerg0 = present_only_in_L1(L1, L2, withindex=True)\nprint(erg0)\nerg1 = present_only_in_L1(L2, L1, withindex=True)\nprint(erg1)\nerg2 = unique_in_L1_and_L2(L1, L2, withindex=True)\nprint(erg2)\nerg3 = present_in_L1_and_L2(L1, L2, withindex=True)\nprint(erg3)\nprint(present_in_all_lists_reduce(L1, [L2, L3, L4]))\nprint(unique_in_each_list_reduce(L1, [L2, L3, L4, L0]))\nprint(present_only_in_L1_reduce(L0, [L2, L3, L4, L1]))\n\n\n\n['a', 'g', 4, 5]\n['ac', (98, 11), 'gc', 11, 2]\n['a', 'g', 4, 5, 'ac', (98, 11), 'gc', 11, 2]\n[{2, 5}, ['bb', ['ccc', 'ddd'], 'ee', 'ff'], 'h', 3, 0.0, 1]\n[(1, 'a'), (3, 'g'), (6, 4), (7, 5)]\n[(1, 'ac'), (2, (98, 11)), (4, 'gc'), (6, 11), (7, 2)]\n[(1, 'a'), (3, 'g'), (6, 4), (7, 5), (1, 'ac'), (2, (98, 11)), (4, 'gc'), (6, 11), (7, 2)]\n[(0, {2, 5}), (2, ['bb', ['ccc', 'ddd'], 'ee', 'ff']), (4, 'h'), (5, 3), (8, 0.0), (9, 1)]\n[{2, 5}, ['bb', ['ccc', 'ddd'], 'ee', 'ff'], 'h', 3, 0.0, 1]\n[111112, {2, 5}, 'jojjo', 'xxx', {77: 100}]\n['jojjo', 'xxx', {77: 100}]\n\t\n```\n\n\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Finds intersections/differences in nested iterables",
    "version": "0.10",
    "split_keywords": [
        "set",
        "nested"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "e27bba151299a27c490dfa4501ef4c59",
                "sha256": "4f94665ee610450583dfac150a7bf92b8fd672f769b84a6a8e3d82662d7b55df"
            },
            "downloads": -1,
            "filename": "set_nested_iters-0.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e27bba151299a27c490dfa4501ef4c59",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 5497,
            "upload_time": "2023-01-02T00:51:25",
            "upload_time_iso_8601": "2023-01-02T00:51:25.685567Z",
            "url": "https://files.pythonhosted.org/packages/75/67/6d1fe9c9b958090a016092c81e0b457f2569f8a8ef73a55b327367295940/set_nested_iters-0.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "1744daf83703a21bec5947c6968366c0",
                "sha256": "3a510d014bf392eba3a0d83bf5830894d86509e735a46dd18beadf0d5886fdac"
            },
            "downloads": -1,
            "filename": "set_nested_iters-0.10.tar.gz",
            "has_sig": false,
            "md5_digest": "1744daf83703a21bec5947c6968366c0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 4066,
            "upload_time": "2023-01-02T00:51:27",
            "upload_time_iso_8601": "2023-01-02T00:51:27.161207Z",
            "url": "https://files.pythonhosted.org/packages/b9/b0/d84c6c62c1048a77f47f064199196fe2491adc4c51e62d6737b95bbe16c7/set_nested_iters-0.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-02 00:51:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "hansalemaos",
    "github_project": "set_nested_iters",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "numpy",
            "specs": []
        }
    ],
    "lcname": "set-nested-iters"
}
        
Elapsed time: 0.02345s