# 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. |
| `object_to_deep_collection` | Convert object to deep collection. | `obj` The object to convert. | `dict, list, set, tuple` A deep collection. |
### 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/6a/df/cef96d9cf5ec3efbe64fd115b33da53fce29321ce5557da69c5cc0d6fb1c/nrt_collections_utils-1.0.2.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| `object_to_deep_collection` | Convert object to deep collection. | `obj` The object to convert. | `dict, list, set, tuple` A deep collection. |\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.2",
"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": "2ad5dcd01099a77dca22d10b0ac62670e9e00da847e4ed7031150b36429fca31",
"md5": "9db6274f49d5b6ca0fb0b4bc2a5f38ea",
"sha256": "ad3eaecaba4fc088978b7811c35ce51d4a423a3d4134a4ffe2de09adba933dcf"
},
"downloads": -1,
"filename": "nrt_collections_utils-1.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9db6274f49d5b6ca0fb0b4bc2a5f38ea",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 4833,
"upload_time": "2024-12-16T09:00:09",
"upload_time_iso_8601": "2024-12-16T09:00:09.225362Z",
"url": "https://files.pythonhosted.org/packages/2a/d5/dcd01099a77dca22d10b0ac62670e9e00da847e4ed7031150b36429fca31/nrt_collections_utils-1.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6adfcef96d9cf5ec3efbe64fd115b33da53fce29321ce5557da69c5cc0d6fb1c",
"md5": "e52df2c48e37cc7082b2a31e55946f0b",
"sha256": "5e6ebe20ae4c6d2a366a601e45c810a7adf383e547cbaf496734b3f49a50649c"
},
"downloads": -1,
"filename": "nrt_collections_utils-1.0.2.tar.gz",
"has_sig": false,
"md5_digest": "e52df2c48e37cc7082b2a31e55946f0b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 4828,
"upload_time": "2024-12-16T09:00:13",
"upload_time_iso_8601": "2024-12-16T09:00:13.507070Z",
"url": "https://files.pythonhosted.org/packages/6a/df/cef96d9cf5ec3efbe64fd115b33da53fce29321ce5557da69c5cc0d6fb1c/nrt_collections_utils-1.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-16 09:00:13",
"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"
}