{ "info": { "author": "Luke (Gorea235)", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# Python Span\nA simple library providing `Span` and `ReadOnlySpan` classes. The idea of these are very similar to [C#'s Span](https://github.com/dotnet/corefxlab/blob/master/docs/specs/span.md), however they are a pure-Python implementation of it. The start and end points are handled via Python's `slice` object, meaning negative ends and starts work as expected, and step works is it does for sliced lists.\n\nThe classes provide read/write and read-only access to certain sections of list-like object, without having to reallocate them via normal slicing. Any object that can be indexed and has a length can be used, meaning you can even create `ReadOnlySpan`s over strings (useful in processing large strings that could have been read from a file).\n\nThese classes are useful when looking at certain regions of a list that is very long (upwards of 100,000s of items). Using the classes looks like this:\n\n```python\nimport math\n\ndata = get_data() # returns a very large list\n\n# we only want the first half of the list\nend = int(math.ceil(len(data) / 2))\n\n# without span\nfirst_half = data[:end] # copies the entire first half\n\n# with span\nfirst_half = Span(data, 0, end)\n# no copies, just a reference is stored, acts like a list of half the length\n```\n\nIn the above example, if the list was very long (e.g. 1,000,000 items), then the first example would copy the entire second half of the list into the new variable, whereas the second example just stores the reference, and the start & end points that you requested. The new Span object would then act exactly like a list of half the length (e.g. `len` would return a length of 500,000 for the example before.). The only allocations that are done are for the Span objects themselves, and the object stores very little data inside (just the start, end, and step values, and the object reference), meaning that it will have little impact on memory by itself.\n\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/Gorea235/python-spanning", "keywords": "list list-like reference large", "license": "", "maintainer": "", "maintainer_email": "", "name": "spanning", "package_url": "https://pypi.org/project/spanning/", "platform": "", "project_url": "https://pypi.org/project/spanning/", "project_urls": { "Bug Reports": "https://github.com/Gorea235/python-spanning/issues", "Homepage": "https://github.com/Gorea235/python-spanning", "Source": "https://github.com/Gorea235/python-spanning" }, "release_url": "https://pypi.org/project/spanning/1.0.0/", "requires_dist": null, "requires_python": "", "summary": "Provides reference-based access over list-like objects", "version": "1.0.0" }, "last_serial": 3828019, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "226e0ccc0a5403eb8cc7c0f365ac1e55", "sha256": "14019e6029158e0aeb6bd95d66d5575c954ec32efae0ba71c3bc7543966b6f5e" }, "downloads": -1, "filename": "spanning-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "226e0ccc0a5403eb8cc7c0f365ac1e55", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4579, "upload_time": "2018-05-02T18:25:37", "url": "https://files.pythonhosted.org/packages/83/5d/00870dadc71e36abb4526372a6f67bdce8060268fed85c8696a58d5fe9b0/spanning-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "be09b3e5f9896cb2eb8635c1f8d0fa16", "sha256": "db15601f68ac64b90c34955c05b9fa9ec4e7d8f3bf88fbc7c905cdec229b519b" }, "downloads": -1, "filename": "spanning-1.0.0.tar.gz", "has_sig": false, "md5_digest": "be09b3e5f9896cb2eb8635c1f8d0fa16", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4370, "upload_time": "2018-05-02T18:25:39", "url": "https://files.pythonhosted.org/packages/df/35/b6ebe23d6c9ae51814bb422b78e5f98a6ad45e949906a0c1659042cd2df4/spanning-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "226e0ccc0a5403eb8cc7c0f365ac1e55", "sha256": "14019e6029158e0aeb6bd95d66d5575c954ec32efae0ba71c3bc7543966b6f5e" }, "downloads": -1, "filename": "spanning-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "226e0ccc0a5403eb8cc7c0f365ac1e55", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4579, "upload_time": "2018-05-02T18:25:37", "url": "https://files.pythonhosted.org/packages/83/5d/00870dadc71e36abb4526372a6f67bdce8060268fed85c8696a58d5fe9b0/spanning-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "be09b3e5f9896cb2eb8635c1f8d0fa16", "sha256": "db15601f68ac64b90c34955c05b9fa9ec4e7d8f3bf88fbc7c905cdec229b519b" }, "downloads": -1, "filename": "spanning-1.0.0.tar.gz", "has_sig": false, "md5_digest": "be09b3e5f9896cb2eb8635c1f8d0fa16", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4370, "upload_time": "2018-05-02T18:25:39", "url": "https://files.pythonhosted.org/packages/df/35/b6ebe23d6c9ae51814bb422b78e5f98a6ad45e949906a0c1659042cd2df4/spanning-1.0.0.tar.gz" } ] }