rcslice is a Python library (version 1.1.0) designed to slice lists of 'sliceables' using a 1-indexed system where both start and end indices are inclusive. This utility helps in specific use cases, such as slicing file content line by line or column by column, offering an alternative to Python's native 0-indexed, end-exclusive slicing. It appears to be a stable, focused utility with infrequent releases.
pip install rcsliceVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to instantiate `RowSlice` and perform basic row and column slicing. It also illustrates how to use a custom separator when combining multiple slice operations, which is crucial for controlling output formatting.
Always remember to use 1-based indexing for `rcslice` inputs (e.g., '1' for the first item, '3' for the third). Ensure your end index includes the last desired element.
Explicitly pass a list to the `RowSlice` constructor to define your separator, e.g., `rs = RowSlice(['---'])` for a single '---' line, or `rs = RowSlice([])` for no separator, or `rs = RowSlice(['', ''])` for two newlines.
Carefully review the 'Slicing syntax' section in the GitHub README for details on how row (r) and column (c) indices interact, especially when both are specified or omitted, and how 'e' (last row) behaves.
Remember that `rcslice` uses 1-based indexing. For the first item, use '1'. For a list of 5 items, the last valid index is '5'. Ensure your slice range (e.g., '1-5') aligns with the 1-indexed length of your data.
If slicing '1-3', it includes elements at 1, 2, and 3. If combining slices (e.g., '1-2,4'), ensure `RowSlice` is instantiated with the desired separator behavior (e.g., `RowSlice([])` for no separator, `RowSlice(['---'])` for a visual separator).
Ensure that if you are performing column-based slicing (e.g., '1.2'), the items within your input list are strings or objects that correctly implement string-like `split()` behavior.
No dependency data recorded yet.