{ "info": { "author": "Kaiwen Wu", "author_email": "kps6326@hotmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development" ], "description": "sliceparser\n===========\n\n\nIntroduction\n------------\n\nAs per [this question](https://stackoverflow.com/q/680826/7881370), creating from string slice object, or even advanced indexing tuple, is a common requirement.\nHowever, there exists few robust and safe solution, if at all, to solve the problem.\nTherefore I attempt to solve it and expose programmatic interface via PyPI.\nI also put my [answer](https://stackoverflow.com/a/57574429/7881370) to the question above.\n\nThis repo is adapted from [my Gist](https://gist.github.com/kkew3/d1eed0984a3a44087c700215e99eefd2).\n\n\nInstall\n-------\n\n```bash\npip install sliceparser\n# or pip3 install sliceparser\n```\n\n\nUsage\n-----\n\n```python\nimport sliceparser\na = [1,2,3,4]\nassert a[sliceparser.parse_slice('2:')] == a[2:]\nassert a[sliceparser.parse_slice('::2')] == a[::2]\nassert a[sliceparser.parse_slice('1')] == a[1]\n\nimport numpy as np\nA = np.eye(3)\nassert np.array_equal(A[sliceparser.parse_slice('0, 1:')], A[0,1:])\nassert np.array_equal(A[sliceparser.parse_slice('..., 2')], A[..., 2])\n```\n\netc.", "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/kkew3/pysliceparser", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "sliceparser", "package_url": "https://pypi.org/project/sliceparser/", "platform": "", "project_url": "https://pypi.org/project/sliceparser/", "project_urls": { "Homepage": "https://github.com/kkew3/pysliceparser" }, "release_url": "https://pypi.org/project/sliceparser/0.9.1b0/", "requires_dist": null, "requires_python": "", "summary": "Parse numpy style advanced indexing notation from string.", "version": "0.9.1b0" }, "last_serial": 5707142, "releases": { "0.9.1b0": [ { "comment_text": "", "digests": { "md5": "1cf04c339272e03317669b1acda40b85", "sha256": "172a316b6e03ce3c5e7d1fbf68460ca1300ed097595481dfe26548a178ba0de8" }, "downloads": -1, "filename": "sliceparser-0.9.1b0.tar.gz", "has_sig": false, "md5_digest": "1cf04c339272e03317669b1acda40b85", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3074, "upload_time": "2019-08-21T05:53:22", "url": "https://files.pythonhosted.org/packages/a8/ae/80507d2962365f02ce17dad0e82206c6addc1c562a03a459fb934aa09bd2/sliceparser-0.9.1b0.tar.gz" } ], "0.9b": [ { "comment_text": "", "digests": { "md5": "f16c8f650128920f87b4ae5d0b1dc396", "sha256": "fb0ce1b3aed414ea86e962a2c5231915e09e7586109b966e3052637e276470a5" }, "downloads": -1, "filename": "sliceparser-0.9b.tar.gz", "has_sig": false, "md5_digest": "f16c8f650128920f87b4ae5d0b1dc396", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2134, "upload_time": "2019-08-20T22:36:49", "url": "https://files.pythonhosted.org/packages/77/be/a1c942f6ec506b0624aea9a4c071d1493874f3d6fb7ce3967d57cea41e90/sliceparser-0.9b.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1cf04c339272e03317669b1acda40b85", "sha256": "172a316b6e03ce3c5e7d1fbf68460ca1300ed097595481dfe26548a178ba0de8" }, "downloads": -1, "filename": "sliceparser-0.9.1b0.tar.gz", "has_sig": false, "md5_digest": "1cf04c339272e03317669b1acda40b85", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3074, "upload_time": "2019-08-21T05:53:22", "url": "https://files.pythonhosted.org/packages/a8/ae/80507d2962365f02ce17dad0e82206c6addc1c562a03a459fb934aa09bd2/sliceparser-0.9.1b0.tar.gz" } ] }