Name | citerate JSON |
Version |
0.1.1
JSON |
| download |
home_page | https://github.com/markmelnic/citerate |
Summary | Python bi-dimensional matrix iterator starting from any point (x, y) iterating layer by layer around some starting coordinates. |
upload_time | 2024-11-15 22:17:16 |
maintainer | None |
docs_url | None |
author | Mark Melnic |
requires_python | ==3.* |
license | MIT |
keywords |
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Circular iterator (Citerate)
Python bi-dimensional matrix iterator starting from any point (x, y) iterating layer by layer around some starting coordinates.
## Usage
pip install citerate
As of __14 july 2021__ it contains one method `citerator`
from citerate import citerator
## Examples
Using the example data set:
DATA = [
[10, 11, 12, 13, 14],
[25, 2, 3, 4, 15],
[24, 9, 1, 5, 16],
[23, 8, 7, 6, 17],
[22, 21, 20, 19, 18],
]
Iterate over the set layer by layer starting from coordinates (x=2, y=2) and print each layer as a list of it's corresponding values.
for layer in citerator(DATA, x=2, y=2, layer=True):
print(layer)
Yields:
[1]
[2, 3, 4, 5, 6, 7, 8, 9]
[10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]
Iterate over the set value by value starting from coordinates (x=2, y=2) and print each value individually.
for value in citerator(DATA, x=2, y=2):
print(value, end=' ')
Yields:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
# Footnotes
- It is NOT mandatory to iterate starting from the central coordinates or for the matrix to be uniform.
- It HAS to be bi-dimenstional and follow a "list of lists" pattern.
Raw data
{
"_id": null,
"home_page": "https://github.com/markmelnic/citerate",
"name": "citerate",
"maintainer": null,
"docs_url": null,
"requires_python": "==3.*",
"maintainer_email": null,
"keywords": null,
"author": "Mark Melnic",
"author_email": "markmelnic@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/09/0c/03a7dce1298f4f3a24e099c0326e34d7275aeae6c81589743ba445e52a27/citerate-0.1.1.tar.gz",
"platform": null,
"description": "# Circular iterator (Citerate)\r\n\r\nPython bi-dimensional matrix iterator starting from any point (x, y) iterating layer by layer around some starting coordinates.\r\n\r\n## Usage\r\n\r\n pip install citerate\r\n\r\nAs of __14 july 2021__ it contains one method `citerator`\r\n\r\n from citerate import citerator\r\n\r\n## Examples\r\n\r\nUsing the example data set:\r\n\r\n DATA = [\r\n [10, 11, 12, 13, 14],\r\n [25, 2, 3, 4, 15],\r\n [24, 9, 1, 5, 16],\r\n [23, 8, 7, 6, 17],\r\n [22, 21, 20, 19, 18],\r\n ]\r\n\r\nIterate over the set layer by layer starting from coordinates (x=2, y=2) and print each layer as a list of it's corresponding values.\r\n\r\n for layer in citerator(DATA, x=2, y=2, layer=True):\r\n print(layer)\r\n\r\nYields:\r\n\r\n [1]\r\n [2, 3, 4, 5, 6, 7, 8, 9]\r\n [10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]\r\n\r\n\r\nIterate over the set value by value starting from coordinates (x=2, y=2) and print each value individually.\r\n\r\n for value in citerator(DATA, x=2, y=2):\r\n print(value, end=' ')\r\n\r\nYields:\r\n\r\n 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25\r\n\r\n# Footnotes\r\n\r\n- It is NOT mandatory to iterate starting from the central coordinates or for the matrix to be uniform.\r\n- It HAS to be bi-dimenstional and follow a \"list of lists\" pattern.\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python bi-dimensional matrix iterator starting from any point (x, y) iterating layer by layer around some starting coordinates.",
"version": "0.1.1",
"project_urls": {
"Homepage": "https://github.com/markmelnic/citerate"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "059cd0d78e53f7f9dcb25a7d6bfc78086672e27d13543c700c39ea0775b21957",
"md5": "1490ac3b4e541187736da1a636d4ba4c",
"sha256": "247b54e04cd4447629dc36c921bf953b8e4cf3fb5c545d6e92a10a396f0f7119"
},
"downloads": -1,
"filename": "citerate-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1490ac3b4e541187736da1a636d4ba4c",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "==3.*",
"size": 3727,
"upload_time": "2024-11-15T22:17:14",
"upload_time_iso_8601": "2024-11-15T22:17:14.950899Z",
"url": "https://files.pythonhosted.org/packages/05/9c/d0d78e53f7f9dcb25a7d6bfc78086672e27d13543c700c39ea0775b21957/citerate-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "090c03a7dce1298f4f3a24e099c0326e34d7275aeae6c81589743ba445e52a27",
"md5": "e2c89bde83a48d11362dfa5b18f33e17",
"sha256": "2287d2c28eb7b05e0fb04364b42ec972d084f92d92947ba9a263224c7d92ccb4"
},
"downloads": -1,
"filename": "citerate-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "e2c89bde83a48d11362dfa5b18f33e17",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "==3.*",
"size": 3878,
"upload_time": "2024-11-15T22:17:16",
"upload_time_iso_8601": "2024-11-15T22:17:16.598014Z",
"url": "https://files.pythonhosted.org/packages/09/0c/03a7dce1298f4f3a24e099c0326e34d7275aeae6c81589743ba445e52a27/citerate-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-15 22:17:16",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "markmelnic",
"github_project": "citerate",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "citerate"
}