slicerator


Nameslicerator JSON
Version 1.1.0 PyPI version JSON
download
home_pagehttp://github.com/soft-matter/slicerator
SummaryA lazy-loading, fancy-sliceable iterable.
upload_time2022-04-07 18:54:08
maintainer
docs_urlNone
authorDaniel B. Allan
requires_python
licenseBSD
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            Slicerator
==========

a lazy-loading, fancy-slicable iterable

Think of it like a generator that is "reusable" and has a length.

[Please see the documentation](http://slicerator.readthedocs.io/en/latest/) for examples and an API reference.

[![build status](https://travis-ci.org/soft-matter/slicerator.png?branch=master)](https://travis-ci.org/soft-matter/slicerator) [![Documentation Status](https://readthedocs.org/projects/slicerator/badge/?version=latest)](http://slicerator.readthedocs.io/en/latest/?badge=latest)

Installation
------------

On any platform, use pip or conda.

`pip install slicerator`

or

`conda install -c conda-forge slicerator`

Example
-------

```python
from slicerator import Slicerator

@Slicerator.from_class
class MyLazyLoader:
    def __getitem__(self, i):
        # this method will be wrapped by Slicerator, so that it accepts slices,
        # lists of integers, or boolean masks. Code below will only be executed
        # when an integer is used.

        # load thing number i
        return thing

    def __len__(self):
        # do stuff
        return number_of_things


# Demo:
>>> a = MyLazyLoader()
>>> s1 = a[::2]  # no data is loaded yet
>>> s2 = s1[1:]  # no data is loaded yet
>>> some_data = s2[0]
```



            

Raw data

            {
    "_id": null,
    "home_page": "http://github.com/soft-matter/slicerator",
    "name": "slicerator",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Daniel B. Allan",
    "author_email": "daniel.b.allan@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/0c/52/f38586b82b2935f8b59a09b0a79c545a22ed062e728c9418bafeb51f61e0/slicerator-1.1.0.tar.gz",
    "platform": "Cross platform (Linux",
    "description": "Slicerator\n==========\n\na lazy-loading, fancy-slicable iterable\n\nThink of it like a generator that is \"reusable\" and has a length.\n\n[Please see the documentation](http://slicerator.readthedocs.io/en/latest/) for examples and an API reference.\n\n[![build status](https://travis-ci.org/soft-matter/slicerator.png?branch=master)](https://travis-ci.org/soft-matter/slicerator) [![Documentation Status](https://readthedocs.org/projects/slicerator/badge/?version=latest)](http://slicerator.readthedocs.io/en/latest/?badge=latest)\n\nInstallation\n------------\n\nOn any platform, use pip or conda.\n\n`pip install slicerator`\n\nor\n\n`conda install -c conda-forge slicerator`\n\nExample\n-------\n\n```python\nfrom slicerator import Slicerator\n\n@Slicerator.from_class\nclass MyLazyLoader:\n    def __getitem__(self, i):\n        # this method will be wrapped by Slicerator, so that it accepts slices,\n        # lists of integers, or boolean masks. Code below will only be executed\n        # when an integer is used.\n\n        # load thing number i\n        return thing\n\n    def __len__(self):\n        # do stuff\n        return number_of_things\n\n\n# Demo:\n>>> a = MyLazyLoader()\n>>> s1 = a[::2]  # no data is loaded yet\n>>> s2 = s1[1:]  # no data is loaded yet\n>>> some_data = s2[0]\n```\n\n\n",
    "bugtrack_url": null,
    "license": "BSD",
    "summary": "A lazy-loading, fancy-sliceable iterable.",
    "version": "1.1.0",
    "project_urls": {
        "Homepage": "http://github.com/soft-matter/slicerator"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e8aefa6cd331b364ad2bbc31652d025f5747d89cbb75576733dfdf8efe3e4d62",
                "md5": "8ac2736c328a5a9757cde7b5cee193f3",
                "sha256": "167668d48c6d3a5ba0bd3d54b2688e81ee267dc20aef299e547d711e6f3c441a"
            },
            "downloads": -1,
            "filename": "slicerator-1.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8ac2736c328a5a9757cde7b5cee193f3",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 10274,
            "upload_time": "2022-04-07T18:54:07",
            "upload_time_iso_8601": "2022-04-07T18:54:07.029396Z",
            "url": "https://files.pythonhosted.org/packages/e8/ae/fa6cd331b364ad2bbc31652d025f5747d89cbb75576733dfdf8efe3e4d62/slicerator-1.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0c52f38586b82b2935f8b59a09b0a79c545a22ed062e728c9418bafeb51f61e0",
                "md5": "30abc2b1d533424706182b78f6f17833",
                "sha256": "44010a7f5cd87680c07213b5cabe81d1fb71252962943e5373ee7d14605d6046"
            },
            "downloads": -1,
            "filename": "slicerator-1.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "30abc2b1d533424706182b78f6f17833",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 38283,
            "upload_time": "2022-04-07T18:54:08",
            "upload_time_iso_8601": "2022-04-07T18:54:08.170925Z",
            "url": "https://files.pythonhosted.org/packages/0c/52/f38586b82b2935f8b59a09b0a79c545a22ed062e728c9418bafeb51f61e0/slicerator-1.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2022-04-07 18:54:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "soft-matter",
    "github_project": "slicerator",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "slicerator"
}
        
Elapsed time: 0.08511s