An open API service indexing awesome lists of open source software.

https://github.com/junhoyeo/chaining

⛓ Package that implements functional chaining in Python, which behaves like JavaScript
https://github.com/junhoyeo/chaining

chaining

Last synced: 5 months ago
JSON representation

⛓ Package that implements functional chaining in Python, which behaves like JavaScript

Awesome Lists containing this project

README

          

# ⛓ Chaining
[![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/)
[![PyPI pyversions](https://img.shields.io/pypi/pyversions/chaining)](https://pypi.org/project/chaining/)
[![MIT LICENSE](https://img.shields.io/pypi/l/chaining)](https://github.com/junhoyeo/chaining/blob/master/LICENSE)
[![PyPI version](https://badge.fury.io/py/chaining.svg)](https://badge.fury.io/py/chaining)
[![PyPI monthly downloads](https://img.shields.io/pypi/dm/chaining)](https://pypistats.org/packages/chaining)

> Package that implements functional chaining in Python, which behaves like JavaScript

## 📦 Installation
This package is not ready to be used in production; There are lots of things still left to be implemented and optimized!

```bash
# only python 3.6 or newer
pip3 install chaining
```

## 🔥 Action

### ChainedArray
```python
>>> from chaining import ChainedArray
>>> array = ChainedArray([1, 2, 3])
>>> array.length
3
>>> array.map(lambda item: item * 2)

>>> other_array = ChainedArray._from('chain').map(lambda item, idx: ord(item) + idx)
>>> other_array.iterable
[99, 105, 99, 108, 114]
>>> array.concat(other_array)

```