enummi


Nameenummi JSON
Version 0.10 PyPI version JSON
download
home_pagehttps://github.com/hansalemaos/enummi
SummaryI love enumerate(), but I hate using it with zip() - this function takes care of it
upload_time2023-07-05 03:52:56
maintainer
docs_urlNone
authorJohannes Fischer
requires_python
licenseMIT
keywords enumerate zip
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# I love enumerate(), but I hate using it with zip() - this function takes care of it 

## pip install enummi 

#### Tested against Windows 10 / Python 3.10 / Anaconda 


### Combining multiple iterables: 

It allows you to merge multiple iterables into a single sequence of tuples. This can be useful when you have several related iterables and want to process them together.

### Indexing the tuples: 

The function assigns an index value to each tuple, representing the position of the elements in the original iterables. This indexing provides a convenient way to access and reference elements based on their relative positions.

### Generates results on the fly: 

As a generator function, enummi generates and yields results one at a time, as they are needed. This lazy evaluation strategy can save memory and computational resources, especially when dealing with large or infinite sequences.

### Flexibility with input: 

The function accepts a variable number of iterables as arguments (*args), allowing you to provide any number of iterables to be combined. It can handle different lengths of input iterables and adapt accordingly.

### Compatible with different iterable types: 

The function can work with various types of iterables, such as lists, tuples, strings, or any other iterable object. It is not limited to a specific data structure, providing flexibility in terms of input.

### Simple and concise implementation: 

The implementation of enummi is relatively straightforward and concise, utilizing built-in Python functions (zip and enumerate) to achieve the desired functionality. This simplicity makes the function easy to understand and maintain.

```python
from enummi import enummi

for i, a, b, c in enummi([1, 2, 3], [4, 5, 6], [7, 8, 9]):
  print(i, a, b, c)
Output:
  0 1 4 7
  1 2 5 8
  2 3 6 9

for i, a in enummi([1, 2, 3]):
  print(i, a)
Output:
  0 1
  1 2
  2 3

for i, a in enummi([]):
  print(i, a)
Output:
  (no output)
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/hansalemaos/enummi",
    "name": "enummi",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "enumerate,zip",
    "author": "Johannes Fischer",
    "author_email": "aulasparticularesdealemaosp@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/b9/53/c2e7c9e8f1a0fbfc82d72377f5c5b9eb97ef47bca65c6d094dc73a199366/enummi-0.10.tar.gz",
    "platform": null,
    "description": "\r\n# I love enumerate(), but I hate using it with zip() - this function takes care of it \r\n\r\n## pip install enummi \r\n\r\n#### Tested against Windows 10 / Python 3.10 / Anaconda \r\n\r\n\r\n### Combining multiple iterables: \r\n\r\nIt allows you to merge multiple iterables into a single sequence of tuples. This can be useful when you have several related iterables and want to process them together.\r\n\r\n### Indexing the tuples: \r\n\r\nThe function assigns an index value to each tuple, representing the position of the elements in the original iterables. This indexing provides a convenient way to access and reference elements based on their relative positions.\r\n\r\n### Generates results on the fly: \r\n\r\nAs a generator function, enummi generates and yields results one at a time, as they are needed. This lazy evaluation strategy can save memory and computational resources, especially when dealing with large or infinite sequences.\r\n\r\n### Flexibility with input: \r\n\r\nThe function accepts a variable number of iterables as arguments (*args), allowing you to provide any number of iterables to be combined. It can handle different lengths of input iterables and adapt accordingly.\r\n\r\n### Compatible with different iterable types: \r\n\r\nThe function can work with various types of iterables, such as lists, tuples, strings, or any other iterable object. It is not limited to a specific data structure, providing flexibility in terms of input.\r\n\r\n### Simple and concise implementation: \r\n\r\nThe implementation of enummi is relatively straightforward and concise, utilizing built-in Python functions (zip and enumerate) to achieve the desired functionality. This simplicity makes the function easy to understand and maintain.\r\n\r\n```python\r\nfrom enummi import enummi\r\n\r\nfor i, a, b, c in enummi([1, 2, 3], [4, 5, 6], [7, 8, 9]):\r\n  print(i, a, b, c)\r\nOutput:\r\n  0 1 4 7\r\n  1 2 5 8\r\n  2 3 6 9\r\n\r\nfor i, a in enummi([1, 2, 3]):\r\n  print(i, a)\r\nOutput:\r\n  0 1\r\n  1 2\r\n  2 3\r\n\r\nfor i, a in enummi([]):\r\n  print(i, a)\r\nOutput:\r\n  (no output)\r\n```\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "I love enumerate(), but I hate using it with zip() - this function takes care of it",
    "version": "0.10",
    "project_urls": {
        "Homepage": "https://github.com/hansalemaos/enummi"
    },
    "split_keywords": [
        "enumerate",
        "zip"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e9b2c6917a0209d4a38ebe64c335f4b748ece6d912e78c6d36b46b5fd4ad9f97",
                "md5": "37a7e5b896ac34f992254072cf3eacaf",
                "sha256": "ba7386c1e0a2dbe54c59bbd4c281e7f74d3217778e3ab2784643165879e19e99"
            },
            "downloads": -1,
            "filename": "enummi-0.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "37a7e5b896ac34f992254072cf3eacaf",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 4941,
            "upload_time": "2023-07-05T03:52:54",
            "upload_time_iso_8601": "2023-07-05T03:52:54.613702Z",
            "url": "https://files.pythonhosted.org/packages/e9/b2/c6917a0209d4a38ebe64c335f4b748ece6d912e78c6d36b46b5fd4ad9f97/enummi-0.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b953c2e7c9e8f1a0fbfc82d72377f5c5b9eb97ef47bca65c6d094dc73a199366",
                "md5": "9cc562d429b76d8deb1a5514c7fc17a6",
                "sha256": "6fabfff8c8529e07feb3fc781e84287e9213cba68e6f00ff6616e1c50046e2a5"
            },
            "downloads": -1,
            "filename": "enummi-0.10.tar.gz",
            "has_sig": false,
            "md5_digest": "9cc562d429b76d8deb1a5514c7fc17a6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 3656,
            "upload_time": "2023-07-05T03:52:56",
            "upload_time_iso_8601": "2023-07-05T03:52:56.186448Z",
            "url": "https://files.pythonhosted.org/packages/b9/53/c2e7c9e8f1a0fbfc82d72377f5c5b9eb97ef47bca65c6d094dc73a199366/enummi-0.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-05 03:52:56",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hansalemaos",
    "github_project": "enummi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "enummi"
}
        
Elapsed time: 0.14383s