--- id: slicerator version: "1.1.0" license: BSD license_treatment: permissive maintenance: aging --- # slicerator — A lazy-loading, fancy-sliceable iterable. License: permissive · Maintenance: aging · Downloads: 337.8K/mo ## What it is and what it does Slicerator is a decorator-based wrapper that turns a class with `__getitem__` and `__len__` methods into a lazy-loading, reusable iterable. Unlike a generator, a Slicerator object can be indexed multiple times and has a known length; unlike a list, it defers data loading until you actually access an element. You decorate your data-loading class with `@Slicerator.from_class`, and the wrapper automatically handles slices (e.g., `obj[::2]`), integer lists, and boolean masks—all without loading data until the final indexing operation. The package is designed for scenarios where you want the convenience of array-like indexing and slicing but need to avoid loading everything into memory upfront. It chains slicing operations lazily, so `obj[::2][1:]` computes the combined slice without materializing intermediate results. With no runtime dependencies and a pure-Python implementation, it integrates easily into existing projects. Use it for: - Wrapping a file reader or database query class to support array-like slicing without loading all records into memory. - Building lazy-loading image or video frame sequences that only decode frames when indexed. - Creating a filtered or transformed view of a dataset that defers computation until specific elements are accessed. - Chaining multiple slice operations on large datasets to avoid intermediate materialization. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Slicerator wraps a class's `__getitem__` method to create a lazy-loading iterable that supports fancy indexing—slices, integer lists, and boolean masks—while deferring data loading until access. Yes, if you need lazy-loading with fancy indexing and have a class-based data source. The low install friction, permissive license, and zero runtime dependencies make it a lightweight addition. However, the package is aging—latest release 2022-04-07—so verify it meets your Python version and use case before committing. ## Install pip install slicerator uv add slicerator poetry add slicerator ## Installing slicerator Before you install: Low friction: pure Python wheel with no runtime dependencies. Maintenance is aging—last release was 2022-04-07 and the repository has not been updated since 2025-06-30, though it remains unarchived. License in practice: BSD license is permissive, allowing commercial and private use with minimal restrictions. Quickstart: from slicerator import Slicerator @Slicerator.from_class class MyLazyLoader: def __getitem__(self, i): return thing def __len__(self): return number_of_things a = MyLazyLoader() s1 = a[::2] data = s1[0] Verify before relying: - Whether the package is actively maintained or in maintenance-only mode given the gap between latest release and recent commits. - Performance characteristics when chaining multiple slicerator operations or working with very large datasets. ## Package facts - License: BSD (permissive) - Python support: unspecified - Install friction: low - Maintenance: aging - Downloads: 337.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags lazy loading iterable, fancy slicing generator, reusable generator with length, deferred data loading, slice-aware iterator wrapper, lazy-loading, iterator-wrapper [View on SkillFed](https://skillfed.io/packages/slicerator) · [View on PyPI](https://pypi.org/project/slicerator/)