skillfed

slicer

A small package for big slicing.

slicer v0.0.8 14.9M downloads/30d#1,214 on PyPI37
Permissive license AGING released

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 on this page — 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

slicer on PyPI

pip

pip install slicer

uv

uv add slicer

poetry

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 the current Python release (>=3.6)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance aging — 888 days since the last release
Last repo commit
First released
Downloads 14,860,793/month — #1,214 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: slicer-0.0.8-py3-none-any.whl

Development Status :: 3 - AlphaLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

uniform slicing interfacemulti-object slicingtensor-like indexingnested array slicingnamed object slicingadvanced indexing wrapperparallel data slicing
data-slicingindexing-wrappermulti-type-support

More Utilities packages