Skip to content
utkashdPublic

About

Python utils I use often

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

udutils

Some Python utility functions and classes I use often.

biter

You can wrap an iterable with biter() and then method-chain .filter() and .map(), like you might in JavaScript. There's also .reduce()

from udutils import biter

my_iterable = [i for i in range(6)]

print(
    biter(my_iterable)
    .filter(lambda num: num > 2)
    .map(lambda num: num**2)
    .reduce(lambda num, acc: acc + ' ' + str(num), "results:")
)

# results: 9 16 25

About

Python utils I use often

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages