Skip to main content

My personal functions.

Project description

My choice of missing python functions.

list.len()
list.map(function)
list.filter(function)
list.join(separator)
list.sortby(function)
list.compact()
list.freq(function=None)
list.groupby(function=None)
list.indexby(function=None)
list.uniq()
list.take(num)
list.drop(num)
list.first()
list.last()

Examples

$ python
>>> import omakase
>>> array = 'the quick brown fox jumps over the lazy dog'.split()
>>> array.map(len)
[3, 5, 5, 3, 5, 4, 3, 4, 3]
>>> array.filter(lambda each: each > 'hello worlds')
['the', 'quick', 'jumps', 'over', 'the', 'lazy']
>>> array.take(3)
['the', 'quick', 'brown']
>>>

Installation

To install this package, run

pip install omakase

Contributing

Bug reports and pull requests are welcome on github at, https://github.com/akuhn/py-omakase

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

omakase-0.6.2.tar.gz (1.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page