Skip to main content

My personal functions.

Project description

My choice of missing python functions.

list.len()
list.join(separator)
list.map(function)
list.filter(function)
list.reduce(function)
list.reduce(initial, function)
list.groupby(function=None)
list.indexby(function=None)
list.freq(function=None)
list.sortby(function)
list.uniq()
list.compact()
list.take(num)
list.drop(num)
list.first()
list.last()
list.zip()
list.min()
list.max()
list.sum()
list.flatten()

tuple.len()
tuple.list()
tuple.join(separator)
tuple.map(function)
tuple.filter(function)
tuple.reduce(function)
tuple.reduce(initial, function)
tuple.groupby(function=None)
tuple.indexby(function=None)
tuple.freq(function=None)
tuple.sortby(function)
tuple.first()
tuple.last()
tuple.zip()
tuple.min()
tuple.max()
tuple.sum()

dict.len()
dict.compact()

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-1.0.0.tar.gz (2.0 kB view details)

Uploaded Source

File details

Details for the file omakase-1.0.0.tar.gz.

File metadata

  • Download URL: omakase-1.0.0.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.10.0 pkginfo/1.4.2 requests/2.9.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.19.8 CPython/2.7.10

File hashes

Hashes for omakase-1.0.0.tar.gz
Algorithm Hash digest
SHA256 ba7be26278ed9921de69b34a8e11274c6e39cb7717bba25a597dccdb3361dc9c
MD5 61e6c01cd0eeacd0e51fcaad463a75c4
BLAKE2b-256 02bd19111497ed284984122300e08af289e3a7ab941ac2c13f588f6990bc2bd4

See more details on using hashes here.

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