SkillAgentSearch skills...

Splitty

functional approach to work with iterables in python

Install / Use

/learn @dunossauro/Splitty
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Build Status Coverage Status

splitty

functional approach to work with iterables in python

Install

pip install splitty

How I use splitty?

You can see examples

Simple example


from splitty import *

>>> list_to_be_splited = ['spam', 1, 2, 3, 'eggs', 1, 2, 3, 'foo', 1, 2, 3]
>>> split_by = ['spam', 'eggs', 'foo']

>>> splited = find_elements(list_to_be_splited, split_by)
# [(0, 'spam'), (4, 'eggs'), (8, 'foo')]

>>> intervals = make_intervals(splited)
# [slice(0, 4, None), slice(4, 8, None), slice(8, None, None)]

>>> list_with_intervals = apply_intervals(list_to_be_splited, intervals)
# [['spam', 1, 2, 3], ['eggs', 1, 2, 3], ['foo', 1, 2, 3]]

# Alternative sintax to all steps
>>> list_with_intervals = list_by_list(list_to_be_splited, split_by)
# [['spam', 1, 2, 3], ['eggs', 1, 2, 3], ['foo', 1, 2, 3]]

# the same way, but using size for split
>>> chunks(list_to_be_splited, size=4)
# [['spam', 1, 2, 3], ['eggs', 1, 2, 3], ['foo', 1, 2, 3]]

Type Hints supported

Based on PEP 484 we implement a stub file for mypy using .pyi in splitty.splitty

TODO:

  • Implement documentation
  • Write tests using hypotheses
  • Lazy alternatives
  • File manipulation objects
View on GitHub
GitHub Stars30
CategoryDevelopment
Updated5mo ago
Forks22

Languages

Python

Security Score

87/100

Audited on Oct 20, 2025

No findings