Skip to content

utkashd/udutils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages