nrt-collections-utils


Namenrt-collections-utils JSON
Version 1.0.0 PyPI version JSON
download
home_pagehttps://github.com/etuzon/python-nrt-collections-utils
SummaryCollections utilities in Python
upload_time2024-06-16 21:06:41
maintainerNone
docs_urlNone
authorEyal Tuzon
requires_python>=3.8
licenseNone
keywords python python3 python-3 tool tools collection collections utilities utils util nrt nrt-utils collections-utils collections-utilities nrt-collections-utils nrt-collections-utilities list list-utils list-utilities nrt-list-utils nrt-list-utilities
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            # Collections Utilities

### Collections utilities in Python.

![PyPI](https://img.shields.io/pypi/v/nrt-collections-utils?color=blueviolet&style=plastic)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/nrt-collections-utils?color=greens&style=plastic)
![PyPI - License](https://img.shields.io/pypi/l/nrt-collections-utils?color=blue&style=plastic)
![PyPI - Downloads](https://img.shields.io/pypi/dd/nrt-collections-utils?style=plastic)
![PyPI - Downloads](https://img.shields.io/pypi/dm/nrt-collections-utils?color=yellow&style=plastic)
[![Coverage Status](https://coveralls.io/repos/github/etuzon/python-nrt-collections-utils/badge.svg)](https://coveralls.io/github/etuzon/pytohn-nrt-collections-utils)
![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/etuzon/python-nrt-collections-utils?style=plastic)
![GitHub last commit](https://img.shields.io/github/last-commit/etuzon/python-nrt-collections-utils?style=plastic)
[![DeepSource](https://app.deepsource.com/gh/etuzon/python-nrt-collections-utils.svg/?label=active+issues&show_trend=false&token=6DkafEgUmnMb_ExVLT-07eDM)](https://app.deepsource.com/gh/etuzon/python-nrt-collections-utils/)

## CollectionsUtil class

### Methods

| **Method**          | **Description**                        | **Parameters**                        | **Returns**                               |
|---------------------|----------------------------------------|---------------------------------------|-------------------------------------------|
| `deep_args_to_list` | Flat deep structure arguments to list. | `args (tuple)` The arguments to flat. | `list` A flatten list.                    |
| `is_iter`           | Check if object is iterable.           | `obj` The object to check.            | `bool` True if iterable, False otherwise. |

### Examples:

- #### CollectionsUtil.deep_args_to_list

    **Code**
    ```python
    from collections_utils import CollectionsUtil

    # Flat deep structure arguments to list
    flat_args = CollectionsUtil.deep_args_to_list(1, 2, (3, 4, (5, 6, (7, 8, 9))))
    print(flat_args)
    ```
    **Output**
    ```
    [1, 2, 3, 4, 5, 6, 7, 8, 9]
    ```
- #### CollectionsUtil.is_iter

  **Code**
    ```python
    from collections_utils import CollectionsUtil

    # Check if object is iterable
    print(CollectionsUtil.is_iter(1))
    print(CollectionsUtil.is_iter([1, 2, 3]))
    ```
    **Output**
    ```
    False
    True
    ```

## ListUtil class

### Methods

| **Method**          | **Description**     | **Parameters**                                      | **Returns**                                      |
|---------------------|---------------------|-----------------------------------------------------|--------------------------------------------------|
| `compare_lists`     | Compare two lists.  | `list_1 (list)` List 1.<br>`list_2 (list)` List 2.  | `bool` True if lists are equal, False otherwise. |
| `remove_none`       | Remove None values. | `list_ (list)` The list to remove None values from. | `list` The list without None values.             |
| `remove_duplicates` | Remove duplicates.  | `list_ (list)` The list to remove duplicates from.  | `list` The list without duplicates.              |

### Examples:

- #### ListUtil.compare_lists

    **Code**
    ```python
    from collections_utils import ListUtil

    # Compare two lists
    print(ListUtil.compare_lists([1, 3, 2], [1, 2, 3]))
    print(ListUtil.compare_lists([1, 2, 3], [1, 2, 4]))
    ```
    **Output**
    ```
    True
    False
    ```
  
- #### ListUtil.remove_none

    **Code**
    ```python
    from collections_utils import ListUtil

    # Remove None values
    print(ListUtil.remove_none([1, None, 2, None, 3]))
    ```
    **Output**
    ```
    [1, 2, 3]
    ```
  
- #### ListUtil.remove_duplicates

    **Code**
    ```python
    from collections_utils import ListUtil

    # Remove duplicates
    print(ListUtil.remove_duplicates([1, 2, 3, 1, 2, 3]))
    ```
    **Output**
    ```
    [1, 2, 3]
    ```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/etuzon/python-nrt-collections-utils",
    "name": "nrt-collections-utils",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "python, python3, python-3, tool, tools, collection, collections, utilities, utils, util, nrt, nrt-utils, collections-utils, collections-utilities, nrt-collections-utils, nrt-collections-utilities, list, list-utils, list-utilities, nrt-list-utils, nrt-list-utilities",
    "author": "Eyal Tuzon",
    "author_email": "Eyal Tuzon <eyal.tuzon.dev@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/a7/c8/4a6167fea6d3588153e61a0184614885069df508294c81028f70aa46a2ff/nrt_collections_utils-1.0.0.tar.gz",
    "platform": null,
    "description": "# Collections Utilities\r\n\r\n### Collections utilities in Python.\r\n\r\n![PyPI](https://img.shields.io/pypi/v/nrt-collections-utils?color=blueviolet&style=plastic)\r\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/nrt-collections-utils?color=greens&style=plastic)\r\n![PyPI - License](https://img.shields.io/pypi/l/nrt-collections-utils?color=blue&style=plastic)\r\n![PyPI - Downloads](https://img.shields.io/pypi/dd/nrt-collections-utils?style=plastic)\r\n![PyPI - Downloads](https://img.shields.io/pypi/dm/nrt-collections-utils?color=yellow&style=plastic)\r\n[![Coverage Status](https://coveralls.io/repos/github/etuzon/python-nrt-collections-utils/badge.svg)](https://coveralls.io/github/etuzon/pytohn-nrt-collections-utils)\r\n![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/etuzon/python-nrt-collections-utils?style=plastic)\r\n![GitHub last commit](https://img.shields.io/github/last-commit/etuzon/python-nrt-collections-utils?style=plastic)\r\n[![DeepSource](https://app.deepsource.com/gh/etuzon/python-nrt-collections-utils.svg/?label=active+issues&show_trend=false&token=6DkafEgUmnMb_ExVLT-07eDM)](https://app.deepsource.com/gh/etuzon/python-nrt-collections-utils/)\r\n\r\n## CollectionsUtil class\r\n\r\n### Methods\r\n\r\n| **Method**          | **Description**                        | **Parameters**                        | **Returns**                               |\r\n|---------------------|----------------------------------------|---------------------------------------|-------------------------------------------|\r\n| `deep_args_to_list` | Flat deep structure arguments to list. | `args (tuple)` The arguments to flat. | `list` A flatten list.                    |\r\n| `is_iter`           | Check if object is iterable.           | `obj` The object to check.            | `bool` True if iterable, False otherwise. |\r\n\r\n### Examples:\r\n\r\n- #### CollectionsUtil.deep_args_to_list\r\n\r\n    **Code**\r\n    ```python\r\n    from collections_utils import CollectionsUtil\r\n\r\n    # Flat deep structure arguments to list\r\n    flat_args = CollectionsUtil.deep_args_to_list(1, 2, (3, 4, (5, 6, (7, 8, 9))))\r\n    print(flat_args)\r\n    ```\r\n    **Output**\r\n    ```\r\n    [1, 2, 3, 4, 5, 6, 7, 8, 9]\r\n    ```\r\n- #### CollectionsUtil.is_iter\r\n\r\n  **Code**\r\n    ```python\r\n    from collections_utils import CollectionsUtil\r\n\r\n    # Check if object is iterable\r\n    print(CollectionsUtil.is_iter(1))\r\n    print(CollectionsUtil.is_iter([1, 2, 3]))\r\n    ```\r\n    **Output**\r\n    ```\r\n    False\r\n    True\r\n    ```\r\n\r\n## ListUtil class\r\n\r\n### Methods\r\n\r\n| **Method**          | **Description**     | **Parameters**                                      | **Returns**                                      |\r\n|---------------------|---------------------|-----------------------------------------------------|--------------------------------------------------|\r\n| `compare_lists`     | Compare two lists.  | `list_1 (list)` List 1.<br>`list_2 (list)` List 2.  | `bool` True if lists are equal, False otherwise. |\r\n| `remove_none`       | Remove None values. | `list_ (list)` The list to remove None values from. | `list` The list without None values.             |\r\n| `remove_duplicates` | Remove duplicates.  | `list_ (list)` The list to remove duplicates from.  | `list` The list without duplicates.              |\r\n\r\n### Examples:\r\n\r\n- #### ListUtil.compare_lists\r\n\r\n    **Code**\r\n    ```python\r\n    from collections_utils import ListUtil\r\n\r\n    # Compare two lists\r\n    print(ListUtil.compare_lists([1, 3, 2], [1, 2, 3]))\r\n    print(ListUtil.compare_lists([1, 2, 3], [1, 2, 4]))\r\n    ```\r\n    **Output**\r\n    ```\r\n    True\r\n    False\r\n    ```\r\n  \r\n- #### ListUtil.remove_none\r\n\r\n    **Code**\r\n    ```python\r\n    from collections_utils import ListUtil\r\n\r\n    # Remove None values\r\n    print(ListUtil.remove_none([1, None, 2, None, 3]))\r\n    ```\r\n    **Output**\r\n    ```\r\n    [1, 2, 3]\r\n    ```\r\n  \r\n- #### ListUtil.remove_duplicates\r\n\r\n    **Code**\r\n    ```python\r\n    from collections_utils import ListUtil\r\n\r\n    # Remove duplicates\r\n    print(ListUtil.remove_duplicates([1, 2, 3, 1, 2, 3]))\r\n    ```\r\n    **Output**\r\n    ```\r\n    [1, 2, 3]\r\n    ```\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Collections utilities in Python",
    "version": "1.0.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/etuzon/python-nrt-collections-utils/issues",
        "Homepage": "https://github.com/etuzon/python-nrt-collections-utils",
        "documentation": "https://github.com/etuzon/python-nrt-collections-utils/wiki"
    },
    "split_keywords": [
        "python",
        " python3",
        " python-3",
        " tool",
        " tools",
        " collection",
        " collections",
        " utilities",
        " utils",
        " util",
        " nrt",
        " nrt-utils",
        " collections-utils",
        " collections-utilities",
        " nrt-collections-utils",
        " nrt-collections-utilities",
        " list",
        " list-utils",
        " list-utilities",
        " nrt-list-utils",
        " nrt-list-utilities"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "84a8b2f4cd7a765d408f2e477aa7dda8afd3af26e510c22aa77c67e1ed827aca",
                "md5": "e8c110cce4c7e44482dc2c41ebbcfde1",
                "sha256": "b8ee763162ee1559d7022bdb3fd8c6691144c4bcfc6d4f544de63381a6796bc3"
            },
            "downloads": -1,
            "filename": "nrt_collections_utils-1.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e8c110cce4c7e44482dc2c41ebbcfde1",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 4652,
            "upload_time": "2024-06-16T21:06:38",
            "upload_time_iso_8601": "2024-06-16T21:06:38.918323Z",
            "url": "https://files.pythonhosted.org/packages/84/a8/b2f4cd7a765d408f2e477aa7dda8afd3af26e510c22aa77c67e1ed827aca/nrt_collections_utils-1.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a7c84a6167fea6d3588153e61a0184614885069df508294c81028f70aa46a2ff",
                "md5": "163bd47c43c15c55c1bb6c1fb1df59ad",
                "sha256": "18549aa5e6a49ca228a4a0ed92b98964a07f353bd1f8cd7f03a572f014d38fa4"
            },
            "downloads": -1,
            "filename": "nrt_collections_utils-1.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "163bd47c43c15c55c1bb6c1fb1df59ad",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 4646,
            "upload_time": "2024-06-16T21:06:41",
            "upload_time_iso_8601": "2024-06-16T21:06:41.819165Z",
            "url": "https://files.pythonhosted.org/packages/a7/c8/4a6167fea6d3588153e61a0184614885069df508294c81028f70aa46a2ff/nrt_collections_utils-1.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-16 21:06:41",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "etuzon",
    "github_project": "python-nrt-collections-utils",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "requirements": [],
    "lcname": "nrt-collections-utils"
}
        
Elapsed time: 0.40672s