{ "info": { "author": "Daniel Paz Avalos", "author_email": "me@dpazavalos.dev", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.5" ], "description": "# CrementalList\n\nExtension of default list obj. Stores and preserves a boundwise bookmarking index. Whole\nlist can be passed between objects with bookmark. Carries functions to safely set ndx,\nincrement, decrement, and a crementer function that takes customizable keys to increment/\ndecrement.\n\n## Installation\n\n```\npip install crementallist\n```\n\n## Usage\n\nRegular startup\n\n```python\nfrom crementallist import CrementalList\ncrelist = CrementalList(['zero', 'one', 'two'])\ncrelist.ndx() \n # returns 0 \ncrelist.active() \n # returns 'zero'\n\ncrelist.increment() \n # ndx = 1\ncrelist.increment() \n # ndx = 2\ncrelist.active() \n # returns 'two'\n\ncrelist.increment() \n # tries to set +1 but not really because it'd be out of bounds so still 2\ncrelist.active() \n # returns 'two'\n```\n\n```python\nfrom crementallist import CrementalList\ncrelist = CrementalList(['zero', 'one', 'two'], raise_bounds_error=True)\ncrelist.set_ndx(7, raise_bounds_error=False) # Set index to 7, suppress out of bounds errors\n\nkeys_to_send = ['-', '+']\ncrelist.crement(keys_to_send[0]) # Send decrementer key \ncrelist.crement(keys_to_send[1]) # Send incrementer key \n\ncrelist.increment()\n```\n\n## Features\n\n* Non-obtrusive to list functionality\n * All enhancements are done without modifying original list object \n\n* Empty list tolerance\n * Cremental List Get functions simply return None if a list starts/becomes []\n\n* 100% self-contained\n * Dependencies-schamendancies\n\n\n## Functions\n\n#####init(seq, increment_key='+', decrement_key='-', raise_bounds_error=False)\n - seq: \n Mutable Sequence to track\n - increment_key: \n Key used by crement() to increment bookmark index by one\n - decrement_key\n Key used by crement() to decrement bookmark index by one\n - raise_bounds_error:\n Optional attribute to raise errors on Out of Bounds bookmark index attempts\n\n#####ndx()\nReturns current active bookmark index, or None if list is []\n\n#####active()\nGet current active item, based off bookmark index, or None if list is []\n\n#####set_ndx(new_ndx: int, raise_bounds_error: bool = None) -> None\nAttempts to set active ndx. Negatives are treated as typical inverse list indexes. By\ndefault, indexes over the limit are treated as [-1]\n - new_ndx:\n Desired bookmark index\n - raise_bounds_error:\n Raises an Index Error if given ndx is outside list boundaries. Defaults to shadow\n class-wide raise_bounds_error, but can be force set if needed\n\n#####def crement(crementer_key, return_ndx=False, raise_bounds_error: bool = None) -> Optional[int]\nCentralized function to call increment/decrement with a given key, crementer_key. Attempts\nto use key, raises KeyError if does not match keys from init. Can return the new active ndx\n - crementer_key:\n Key to pass, from initialized incrementer/decrementer\n - return_ndx:\n Optional attribute to return newly set index\n - raise_bounds_error:\n Raises an Index Error if given ndx is outside list boundaries. Defaults to shadow\n class-wide raise_bounds_error, but can be force set if needed\n\n#####increment(return_ndx=False, raise_bounds_error: bool = None) -> Optional[int]\nSafe manual call to increment bookmark index by one\n - return_ndx:\n Optional attribute to return newly set index\n - raise_bounds_error:\n Raises an Index Error if given ndx is outside list boundaries. Defaults to shadow\n class-wide raise_bounds_error, but can be force set if needed\n\n#####decrement(return_ndx=False, raise_bounds_error: bool = None) -> Optional[int]\nSafe manual call to decrement bookmark index by one\n\n - return_ndx:\n Optional attribute to return newly set index\n - raise_bounds_error:\n Raises an Index Error if given ndx is outside list boundaries. Defaults to shadow\n class-wide raise_bounds_error, but can be force set if needed\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dpazavalos/datatypes/tree/master/crementallist", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "crementallist", "package_url": "https://pypi.org/project/crementallist/", "platform": "", "project_url": "https://pypi.org/project/crementallist/", "project_urls": { "Homepage": "https://github.com/dpazavalos/datatypes/tree/master/crementallist" }, "release_url": "https://pypi.org/project/crementallist/0.2.0/", "requires_dist": null, "requires_python": "", "summary": "Extension of default list obj, with bookmarks and boundary checks", "version": "0.2.0" }, "last_serial": 4966259, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "ce57552424fbf62da0fa23a8c1c6700d", "sha256": "d8a3df07794d925ff7afaf8434faa5434d4c5c1c8816c86b930caa33bf04d974" }, "downloads": -1, "filename": "crementallist-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "ce57552424fbf62da0fa23a8c1c6700d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4522, "upload_time": "2019-02-16T23:39:07", "url": "https://files.pythonhosted.org/packages/a6/87/d915d5310d32911891cf2bc9b47fc317d10509275256407cacca3502902e/crementallist-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "22d0883746ce15dd88954624d6589cd6", "sha256": "a8e2374e76b4095c250d505e62fb3e4b8661a41f4ddcd39feae1eb7ac1723e0a" }, "downloads": -1, "filename": "crementallist-0.1.0.tar.gz", "has_sig": false, "md5_digest": "22d0883746ce15dd88954624d6589cd6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3369, "upload_time": "2019-02-16T23:39:09", "url": "https://files.pythonhosted.org/packages/17/05/efa668472fdd568ce27d3844838a7a74e7f74c82d356049678d1ebe112e6/crementallist-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "a320f2aaef8e76ff33c8fada71d7db6c", "sha256": "404f406fb467904f2089a611957ae3782868e41935e4f6780641429101af6444" }, "downloads": -1, "filename": "crementallist-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "a320f2aaef8e76ff33c8fada71d7db6c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5446, "upload_time": "2019-03-21T01:58:48", "url": "https://files.pythonhosted.org/packages/49/04/42e87e791955dba9a61a5bf91dc4772c22841ee1359d232b52ffcd0e77da/crementallist-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "841673e34365a714aa066402d8e1dbe4", "sha256": "a294335d0fa9e1ff945837d0f1b2fd3451f0412350cc9c452ecebfa754d23063" }, "downloads": -1, "filename": "crementallist-0.2.0.tar.gz", "has_sig": false, "md5_digest": "841673e34365a714aa066402d8e1dbe4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4085, "upload_time": "2019-03-21T01:58:49", "url": "https://files.pythonhosted.org/packages/34/3d/73d25b0de0ce64a80f9c15788acbd9395980f974d97cbb7a61ae0960102c/crementallist-0.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a320f2aaef8e76ff33c8fada71d7db6c", "sha256": "404f406fb467904f2089a611957ae3782868e41935e4f6780641429101af6444" }, "downloads": -1, "filename": "crementallist-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "a320f2aaef8e76ff33c8fada71d7db6c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 5446, "upload_time": "2019-03-21T01:58:48", "url": "https://files.pythonhosted.org/packages/49/04/42e87e791955dba9a61a5bf91dc4772c22841ee1359d232b52ffcd0e77da/crementallist-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "841673e34365a714aa066402d8e1dbe4", "sha256": "a294335d0fa9e1ff945837d0f1b2fd3451f0412350cc9c452ecebfa754d23063" }, "downloads": -1, "filename": "crementallist-0.2.0.tar.gz", "has_sig": false, "md5_digest": "841673e34365a714aa066402d8e1dbe4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4085, "upload_time": "2019-03-21T01:58:49", "url": "https://files.pythonhosted.org/packages/34/3d/73d25b0de0ce64a80f9c15788acbd9395980f974d97cbb7a61ae0960102c/crementallist-0.2.0.tar.gz" } ] }