slicerator-1.1.0
توضیحات
A lazy-loading, fancy-sliceable iterable.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | slicerator-1.1.0 |
| نام | slicerator |
| نسخه کتابخانه | 1.1.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Daniel B. Allan |
| ایمیل نویسنده | daniel.b.allan@gmail.com |
| آدرس صفحه اصلی | http://github.com/soft-matter/slicerator |
| آدرس اینترنتی | https://pypi.org/project/slicerator/ |
| مجوز | BSD |
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.
[](https://travis-ci.org/soft-matter/slicerator) [](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]
```
نحوه نصب
نصب پکیج whl slicerator-1.1.0:
pip install slicerator-1.1.0.whl
نصب پکیج tar.gz slicerator-1.1.0:
pip install slicerator-1.1.0.tar.gz