<commit_before># The Fluent python library

Fluent helps you write more object-oriented and concise python code.

It is inspired by `jQuery` and `underscore` / `lodash` from the JavaScript world. It also takes some inspiration from Ruby / SmallTalk -- in particular, collections and how to work with them.

Please Note: **This library is an experiment.** It is based on a wrapper that aggressively wraps anything it comes in contact with and tries to stay invisible. We'll address this in section **Caveats** below.

[![Documentation Status](https://readthedocs.org/projects/fluentpy/badge/?version=latest)](https://fluentpy.readthedocs.io/en/latest/?badge=latest)

## Introduction: Why use `fluentpy`?

The Python standard library includes many useful, time-saving convenience methods such as `map`, `zip`, `filter` and `join`. The problem that motivated me to write `fluentpy` is that these convenience methods are often available as free functions or on (arguably) the wrong object.

For example, `map`, `zip`, and `filter` all operate on `iterable` objects but they are implemented as free functions. This not only goes against my sense of how object oriented code should behave, but more importantly, writing python code using these free functions requires that the reader must often mentally skip back and forth in a line of code to understand what it does, making the code more difficult to understand.

Let's use the following simple example to analyze this problem:

    >>> map(print, map(str.upper, sys.stdin.read().split('\n')))

How many backtrackings did you have to do? I read this code as follows: 

I start in the middle at `sys.stdin.read().split('\n')`, then I backtrack to `map(str.upper, …)`, then to `map(print, …)`. I also have to make sure that the parentheses all match up.
<commit_msg>better intro<commit_after># The Fluent python library

Fluent helps you write more object-oriented and concise python code.

It is inspired by `jQuery` and `underscore` / `lodash` from the JavaScript world. It also takes some inspiration from Ruby / SmallTalk -- in particular, collections and how to work with them.

Please Note: **This library is an experiment.** It is based on a wrapper that aggressively wraps anything it comes in contact with and tries to stay invisible. We'll address this in section **Caveats** below.

[![Documentation Status](https://readthedocs.org/projects/fluentpy/badge/?version=latest)](https://fluentpy.readthedocs.io/en/latest/?badge=latest)

## Introduction: Why use `fluentpy`?

The Python standard library includes many useful, time-saving convenience methods such as `map`, `zip`, `filter` and `join`. The problem that motivated me to write `fluentpy` is that these convenience methods are often available as free functions or on (arguably) the wrong module or class.

For example, `map`, `zip`, and `filter` all operate on `iterable` objects but they are implemented as free functions. This not only goes against my sense of how object oriented code should behave, but more importantly, writing python code using these free functions requires that the reader must often mentally skip back and forth in a line of code to understand what it does, making the code more difficult to understand.

Let's use the following simple example to analyze this problem:

    >>> map(print, map(str.upper, sys.stdin.read().split('\n')))

How many backtrackings did you have to do? I read this code as follows: 

I start in the middle at `sys.stdin.read().split('\n')`, then I backtrack to `map(str.upper, …)`, then to `map(print, …)`. I also have to make sure that the parentheses all match up.

{'fraction_non_alphanumeric': 0.08484848484848485, 'fraction_numerical': 0.0, 'mean_word_length': 4.7271293375394325, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1611152', 'n_tokens_mistral': 957, 'n_tokens_neox': 921, 'n_words': 507}