Skip to content

Suor/funcy

Repository files navigation

Funcy Build Status =====

A collection of fancy functional tools focused on practicality.

Inspired by clojure, underscore and my own abstractions. Keep reading to get an overview or read the docs. Or jump directly to cheatsheet.

Works with Python 3.4+ and pypy3.

Installation

pip install funcy

Overview

Import stuff from funcy to make things happen:

Merge collections of same type (works for dicts, sets, lists, tuples, iterators and even strings):

Walk through collection, creating its transform (like map but preserves type):

Select a part of collection:

Manipulate sequences:

And functions:

Create decorators easily:

Abstract control flow:

Ease debugging:

And much more.

Dive in

Funcy is an embodiment of ideas I explain in several essays:

Related Projects

Running tests

To run the tests using your default python:

pip install -r test_requirements.txt
py.test

To fully run tox you need all the supported pythons to be installed. These are 3.4+ and PyPy3. You can run it for particular environment even in absense of all of the above:

tox -e py310
tox -e pypy3
tox -e lint