Skip to main content

Enables Python to be functionally chain-styled.

Project description

# Function-Chain-Python

[![Build Status](https://travis-ci.org/Thoxvi/Function-Chain-Python.svg?branch=master)](https://travis-ci.org/Thoxvi/Function-Chain-Python) [![PyPI](https://img.shields.io/pypi/v/fc.svg)](https://pypi.python.org/pypi/fc)

Enables Python to be functionally chain-styled.

## Document

- **Simplified Chinese documents** **[here](./docs/zh-CN/main/README.md)**.

If you are interested in me,you can follow my [Blog](https://blog.thoxvi.com/2018/05/17/Fuck%E8%BF%99%E4%B8%AA%E4%B8%96%E7%95%8C%E4%B8%8D%E5%A4%9F%E5%A5%BD%E7%9A%84%E4%B8%9C%E8%A5%BF/)(~~一波软广2333~~)。

## How to use?

install form pypi

```
$ pip install fc
```

and you just import `Fc`,like this: `from fc import Fc`

then you can enjoy lambda like Kotlin/JS:

```python
from fc import Fc

l = (
Fc([1, 2, 3, 4, 5])
.map(lambda x: x + 1)
.filter(lambda x: x > 4)
.print()
# [5, 6]
.map(lambda x: x + 1)
.done()
)
assert l == [6, 7]
```

You can check this this [test file](./tests/test_fc.py) and understand more

## Have Fun ;)

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

fc-0.1.7.tar.gz (5.5 kB view details)

Uploaded Source

File details

Details for the file fc-0.1.7.tar.gz.

File metadata

  • Download URL: fc-0.1.7.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for fc-0.1.7.tar.gz
Algorithm Hash digest
SHA256 dca104cad6bfe3ce0fc738a7383e6a94c1e87ec397e632742c7008f297cb6d6c
MD5 9e0db8e6e1aaffcd01eaeac1efb65f3e
BLAKE2b-256 31ec6d2bfc67af0abbeb19d7261432cd83055c209caf6d835db3fc98c4452760

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