--- id: slicer version: "0.0.8" license: unclear license_treatment: permissive maintenance: aging --- # slicer — A small package for big slicing. License: permissive · Maintenance: aging · Downloads: 14.9M/mo ## What it is and what it does Slicer wraps tensor-like objects and provides a single, uniform slicing syntax that works across numpy arrays, pandas DataFrames, scipy sparse matrices, PyTorch tensors, and Python built-ins (lists, tuples, dicts). Instead of learning each library's indexing conventions, you wrap objects with `S()` and slice them all the same way via `__getitem__`. The package handles non-integer indexes (useful for selecting DataFrame columns by name), nested slicing in one call, and simultaneous slicing of multiple objects at once—returning results as named attributes or via `.o` for anonymous access. With zero runtime dependencies and support for Python 3.6+, slicer is lightweight and portable. It's designed for workflows where you need to slice multiple heterogeneous data structures in parallel. The package includes an Alias mechanism to use semantic keys as slicing indices, bridging the gap between positional and label-based indexing. Use it for: - Slice multiple data structures in parallel with a single index operation - Select DataFrame columns by name using the same syntax as positional array slicing - Extract nested subsets from mixed-type data structures in one call - Build data pipelines with consistent indexing across multiple data types - Use semantic aliases as slicing keys without manual index lookup ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a uniform slicing interface for tensor-like objects (numpy, pandas, scipy, PyTorch, lists, tuples, dicts) via `__getitem__`, enabling non-integer indexing and nested slicing in a single call. Yes, if you regularly slice multiple heterogeneous data structures and want a unified interface. The zero-dependency design and permissive license make it safe to add. The alpha status and lack of updates since 2024-03-09 are minor concerns for a stable utility, but verify it handles your specific data types before production use. ## Install pip install slicer uv add slicer poetry add slicer ## Installing slicer Before you install: No runtime dependencies and a pure-Python wheel make installation frictionless. The package is in alpha status and hasn't been updated since 2024-03-09, though the repository remains active. License in practice: MIT license (permissive) allows use in most projects without restriction, including commercial and proprietary work. Quickstart: from slicer import Slicer as S li = [[1, 2, 3], [4, 5, 6]] S(li)[:, 0:2].o # [[1, 2], [4, 5]] # Named slicing across multiple objects sliced = S(first=df, second=ar)[0, :] sliced.first Verify before relying: - Whether the alpha status reflects incomplete features or conservative versioning - Performance characteristics when slicing very large objects or deeply nested structures - Compatibility with versions of numpy, pandas, and PyTorch beyond what classifiers declare ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: aging - Downloads: 14.9M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags uniform slicing interface, multi-object slicing, tensor-like indexing, nested array slicing, named object slicing, advanced indexing wrapper, parallel data slicing, data-slicing, indexing-wrapper, multi-type-support [View on SkillFed](https://skillfed.io/packages/slicer) · [View on PyPI](https://pypi.org/project/slicer/)