Skip to main content

Method chaining with funcy.

Project description

funcy-chain

Method chaining with funcy.

>>> from funcy_chain import chain
>>> (
...     chain([1, 2, 3, 7, 6, 5, 4])
...         .without(3)
...         .filter(lambda x: x > 2)
...         .remove(lambda x: x > 6)
...         .sort(reverse=True)
... ).value
[6, 5, 4]

Why?

funcy is great, but doesn't support method chaining. pydash is similar to funcy and does support chaining, but it is more complex and its chains are harder to debug. funcy-chain enables method chaining with built-in, stdlib and funcy functions, in a way that is simple and straightforward.

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

funcy-chain-0.1.1.tar.gz (10.1 kB view hashes)

Uploaded Source

Built Distribution

funcy_chain-0.1.1-py3-none-any.whl (4.8 kB view hashes)

Uploaded Python 3

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