pyiota


Namepyiota JSON
Version 1.2.1 PyPI version JSON
download
home_page
SummarySimple Go lang iota pattern implementation
upload_time2023-03-24 18:31:44
maintainer@jedi2light
docs_urlNone
author@jedi2light
requires_python>=3.6
licenseWTFPL
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # PyIota - Simple Go lang iota pattern implementation

## Simple Usage

```python3
from pyiota import iota

with iota.start():
  A = iota()
  B = iota()
  C = iota()
with iota.start(10):
  D = iota()
  E = iota()
  F = iota()
print(A, B, C, D, E, F) #=> '0 1 2 10 11 12'
```

## How it works?

0. Default `iota._counter` value equals to `-1`.
1. `A = iota()` - `iota.__new__()` increments `iota._counter` and returns it.
2. It is possible to reset `iota._counter` calling `iota()` within `with iota.start(): ...` block.  
    2.1. You can also provide a number to start from. For example: `D`, `E` and `F` from example above will be equal to `10`, `11`, and `12` accrordingly.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "pyiota",
    "maintainer": "@jedi2light",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "jedi2light@jedi2light.moe",
    "keywords": "",
    "author": "@jedi2light",
    "author_email": "jedi2light@jedi2light.moe",
    "download_url": "",
    "platform": null,
    "description": "# PyIota - Simple Go lang iota pattern implementation\n\n## Simple Usage\n\n```python3\nfrom pyiota import iota\n\nwith iota.start():\n  A = iota()\n  B = iota()\n  C = iota()\nwith iota.start(10):\n  D = iota()\n  E = iota()\n  F = iota()\nprint(A, B, C, D, E, F) #=> '0 1 2 10 11 12'\n```\n\n## How it works?\n\n0. Default `iota._counter` value equals to `-1`.\n1. `A = iota()` - `iota.__new__()` increments `iota._counter` and returns it.\n2. It is possible to reset `iota._counter` calling `iota()` within `with iota.start(): ...` block.  \n    2.1. You can also provide a number to start from. For example: `D`, `E` and `F` from example above will be equal to `10`, `11`, and `12` accrordingly.\n",
    "bugtrack_url": null,
    "license": "WTFPL",
    "summary": "Simple Go lang iota pattern implementation",
    "version": "1.2.1",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d177dd52cbcb6d46f9da0fc4ef8d5955aa5ed6f715f5017ab12e61049ac19f50",
                "md5": "110eac4ad7556f1aa8d5ab635d323dfc",
                "sha256": "0a1166c23344ca07e55d44e7b4a79052f8b26768d6de6eee26e0a129bc830010"
            },
            "downloads": -1,
            "filename": "pyiota-1.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "110eac4ad7556f1aa8d5ab635d323dfc",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 2488,
            "upload_time": "2023-03-24T18:31:44",
            "upload_time_iso_8601": "2023-03-24T18:31:44.396564Z",
            "url": "https://files.pythonhosted.org/packages/d1/77/dd52cbcb6d46f9da0fc4ef8d5955aa5ed6f715f5017ab12e61049ac19f50/pyiota-1.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-24 18:31:44",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "pyiota"
}
        
Elapsed time: 0.05006s